Part Number Hot Search : 
74HC59 SKN130 MBD4148 MAX4142 ZR32112 P11NM60 TA0997A L4812
Product Description
Full Text Search
 

To Download TMP91C820A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 TOSHIBA Original CMOS 16-Bit Microcontroller
TLCS-900/L1 Series
TMP91C820A
Semiconductor Company
Preface
Thank you very much for making use of Toshiba microcomputer LSIs. Before use this LSI, refer the section, "Points of Note and Restrictions". Especially, take care below cautions.
**CAUTION** How to release the HALT mode Usually, interrupts can release all halts status. However, the interrupts = (NMI , INT0 to INT3, INTRTC, INTALM0 to INTALM4, INTKEY), which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 5 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to HALT mode completely, halt status can be released without difficultly. The priority of this interrupt is compare with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
TMP91C820A
CMOS 16-Bit Microcontrollers
TMP91C820AF/JT5AW4-S 1. Outline and Features
TMP91C820A/JT5AW4 is a high-speed 16-bit microcontroller designed for the control of various mid- to large-scale equipment. TMP91C820AF comes in a 144-pin flat package. JT5AW4-S comes in a 144-pad chip. Listed below are the features. (1) High-speed 16-bit CPU (900/L1 CPU) Instruction mnemonics are upward compatible with TLCS-90 16 Mbytes of linear address space General-purpose registers and register banks 16-bit multiplication and division instructions; bit transfer and arithmetic instructions Micro DMA: 4 channels (444 ns/2 bytes at 36 MHz) (2) Minimum instruction execution time: 111ns (at 36 MHz) (3) Built-in RAM: 8 Kbytes Built-in ROM: 8 Kbytes (However, 9999 (ROM code) has no internal ROM.)
91C820A-1
2006-01-31
TMP91C820A
(4) External memory expansion * * * Expandable up to 136 Mbytes (Shared program/data area) Can simultaneously support 8- or 16-bit width external data bus ... Dynamic data bus sizing Separate bus system
(5) 8-bit timers: 4 channels (6) 16-bit timer: 1 channel (7) General-purpose serial interface: 3 channels * * UART/synchronous mode IrDA
(8) Serial bus interface: 1 channel I2C bus mode/clock synchronous select mode (9) LCD controller * * * Shift register/built-in RAM LCD driver Supported 16, 8 and 4 gray levels and black and white Hardware blinking cursor
(10) SDRAM controller Supported 16-M, 64-M and 128-Mbit SDRAM with 16-bit data bus (11) Timer for real time clock (RTC) * Based on TC8521A (12) Key-on wakeup (Interrupt key input) (13) 10-bit AD converter: 8 channels (14) Watchdog timer (15) Melody/alarm generator * * * Melody: Output of clock 4 to 5461 Hz Alarm: Output of the 8 kinds of alarm pattern Output of the 5 kinds of interval interrupt
(16) Chip select/wait controller: 4 channels (17) MMU * * * * Expandable up to 136 Mbytes (4 local area/8-bank method) 9 CPU interrupts: Software interrupt instruction and illegal instruction 31 internal interrupts: Seven selectable priority levels 6 external interrupts: Seven selectable priority levels (4-edge selectable) (18) Interrupts: 46 interrupts
(19) Input/output ports: 77 pins (at external 16-bit data bus memory) (20) Standby function Three HALT modes: IDLE2 (Programmable), IDLE1, STOP (21) Hardware standby function (Power save function)
91C820A-2
2006-01-31
TMP91C820A
(22) Triple-clock controller Clock doubler (DFM) Clock gear function: Select a high-frequency clock fc to fc/16 RTC (fs = 32.768 kHz) (23) Operating voltage * * * * VCC = 2.7 V to 3.6 V (fc = 27 MHz) VCC = 3.0 V to 3.6 V (fc max = 36 MHz) 144-pin QFP: P-LQFP144-1616-0.40C Chip form supply also available. For details, contact your local Toshiba sales representative.
(24) Package
91C820A-3
2006-01-31
TMP91C820A
ADTRG (P83)
CPU (TLCS-900/L1)
H-OSC
Clock gear, clock doubler
AN0 to AN7 (P80 to P87) AVCC, AVSS VREFH, VREFL TXD0 (PC0) RXD0 (PC1) SCLK0/ CTS0 (PC2) TXD1 (PC3) RXD1 (PC4) SCLK1/ CTS1 (PC5) OPTRX0, SCK (P70)
OPTTX0, SO/SDA (P71) SI/SCL (P72)
10-bit 8ch AD converter
DVCC [3] DVSS [7] X1 X2 EMU0 EMU1 XT1 XT2
RESET
SIO/UART/IrDA
(SIO0) SIO/UART (SIO1) Serial bus I/F (SBI) 8-bit timer (TMRA0) 8-bit timer (TMRA1) 8-bit timer (TMRA2)
XWA XBC XDE XHL XIX XIY XIZ XSP
WA BC DE HL IX IY IZ SP 32 bits F SR PC
L-OSC
AM0 AM1 Port 0 Port 1 Port 2 P00 to P07(D0 to D7) P10 to P17(D8 to D15) P20 to P27 (A16 to A23) P30 to P37(A8 to A15) P40 to P47(A0 to A7)
RD (PZ0) WR (PZ1) HWR (PZ2) R / W , SRWR (PZ3) WAIT (P56) CS0 to CS3 , CS2A (P60 to P63)
WDT (Watchdog timer)
Port 3 Port 4
TXD2/TA0IN (PB0) RXD2/TA1OUT (PB1)
8-Kbyte SRAM
Port 5/ Port Z
CS/WAIT controller (4 blocks)
TA3OUT/INT2 (PB5)
8-bit timer (TMRA3) Port 6 8-Kbyte MROM (Note) Port 7
MSK (P76), VEECLK (P77)
CS2F (P73) CS2G (P74) CSEXA (P75)
MMU
Port 8 Port 9 Port A Port B Port C Port D Port E Port F D1BSCP (PD0) D2BLP (PD1) D3BFR (PD2) DLEBCD (PD3) DOFFB (PD4) LD0 to LD7 (PE0 to PE7) TB0OUT0/INT3 (PB6) LCD controller
Interrupt controller
EA24, CS2B (P64), EA25, CS2C (P65), CS2D / SRLB (P66), CS2E / SRUB (P67) CS2F (P73) CS2G (P74) CSEXA (P75) NMI / PS
Keyboard I/F Melody/ alarm out RTC SIO/UART (SIO2)
INT0 to INT3,TA3OUT, TB0OUT0 (PB3 to PB6) KI0 to KI7 (P90 to P97) KO0 to KO7 (PA0 to PA7)
MLDALM (PD7)
ALARM , MLDALM (PD6)
TXD2/TA0IN (PB0) RXD2/TA1OUT (PB1) SDCKE (PF5) SDCLK (PF6) SDLDQM (PF3) SDUDQM (PF4) SDWE (PF2) SDRAS (PF0) SDCAS (PF1) SDCS (P61)
16-bit timer (TMRB0)
SDRAM controller
( ): Initial function after reset
Note: When ROM code is 9999, it has no ROM.
Figure 1.1 TMP91C820A Block Diagram
91C820A-4
2006-01-31
TMP91C820A
2.
Pin Assignment and Pin Functions
The assignment of input/output pins for the TMP91C820A, their names and functions are as follows:
2.1
Pin Assignment Diagram
Figure 2.1.1 shows the pin assignment of the TMP91C820AF.
P80/AN0 VREFH VREFL NMI /PS P91/KI1 P90/KI0 PF7 PF6/SDCLK DVSS7 PF5/SDCKE PF4/SDUDQM PF3/SDLDQM PD7/MLDALM PD6/ ALARM / MLDALM P77/VEECLK P76/MSK P75/ CSEXA P74/ CS2G P73/ CS2F DVCC3 P72/SI/SCL P71/SO/SDA/OPTTX0 P70/SCK/OPTRX0 P67/ CS2E / SRUB P66/ CS2D / SRLB P65/EA25/ CS2C P64/EA24/ CS2B P63/ CS3 DVSS6 P62/ CS2 / CS2A P61/ CS1/ SDCS P60/ CS0 P56/ WAIT PZ3/ R/W / SRWE PZ2/ HWR PZ1/ WR
125
135
130
120
115
40
60
65
45
50
SDWE /PF2 D1BSCP/PD0 AM0 DVCC1 X2 DVSS2 X1 AM1
Figure 2.1.1 Pin Assignment Diagram (144-pin QFP)
XT1 XT2 EMU0 EMU1 D2BLP/PD1 D3BFR/PD2 DLEBCD/PD3 DOFFB/PD4 LD0/PE0 LD1/PE1 LD2/PE2 LD3/PE3 LD4/PE4 LD5/PE5 LD6/PE6 LD7/PE7 DVSS3 P00/D0 P01/D1 P02/D2 P03/D3 P04/D4 P05/D5 P06/D6 P07/D7
SDRAS /PF0 SDCAS /PF1
RESET
55
70
P81/AN1 P82/AN2 P83/AN3/ ADTRG P84/AN4 P85/AN5 P86/AN6 P87/AN7 AVSS AVCC KI2/P92 KI3/P93 KI4/P94 KI5/P95 KI6/P96 KI7/P97 KO0/PA0 KO1/PA1 KO2/PA2 KO3/PA3 KO4/PA4 KO5/PA5 KO6/PA6 KO7/PA7 TXD2/TA0IN/PB0 RXD2/TA1OUT/PB1 INT0/PB3 INT1/PB4 DVSS1 TA3OUT/INT2/PB5 TB0OUT0/INT3/PB6 TXD0/PC0 RXD0/PC1 SCLK0/ CTS0 /PC2 TXD1/PC3 RXD1/PC4 SCLK1/ CTS1 /PC5
1
140
110
105 5
100 10
95 15
TMP91C820AF
QFP144
90
20
Top view
85 25
80 30
75 35
PZ0/ RD P27/A23 P26/A22 P25/A21 P24/A20 P23/A19 P22/A18 P21/A17 DVSS5 P20/A16 DVCC2 P37/A15 P36/A14 P35/A13 P34/A12 P33/A11 P32/A10 P31/A9 P30/A8 P47/A7 P46/A6 P45/A5 P44/A4 P43/A3 P42/A2 P41/A1 P40/A0 D15/P17 DVSS4 D14/P16 D13/P15 D12/P14 D11/P13 D10/P12 D9/P11 D8/P10
91C820A-5
2006-01-31
TMP91C820A
2.2
PIN No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
PAD layout
Unit: m
(Chip size 5.75 mm x 5.63 mm)
Name
P81 P82 P83 P84 P85 P86 P87 AVSS AVCC P92 P93 P94 P95 P96 P97 PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PB0 PB1 PB3 PB4 DVSS1 PB5 PB6 PC0 PC1 PC2 PC3 PC4 PC5 PF0 PF1 PF2 PD0 AM0 DVCC1 X2 DVSS2 X1 AM1
RESET
X Point Y Point
-2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2742 -2194 -2068 -1954 -1840 -1726 -1612 -1410 -1244 -1079 -963 -849 -734 2128 2004 1888 1774 1660 1546 1432 1318 1204 892 778 664 550 436 322 208 94 -20 -134 -248 -362 -476 -590 -704 -818 -932 -1046 -1210 -1324 -1438 -1552 -1666 -1780 -1894 -2010 -2134 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682
PIN No.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
Name
XT2 EMU0 EMU1 PD1 PD2 PD3 PD4 PE0 PE1 PE2 PE3 PE4 PE5 PE6 PE7 DVSS3 P00 P01 P02 P03 P04 P05 P06 P07 P10 P11 P12 P13 P14 P15 P16 DVSS4 P17 P40 P41 P42 P43 P44 P45 P46 P47 P30 P31 P32 P33 P34 P35 P36
X Point Y Point
-485 -370 -256 -142 -28 86 200 314 428 542 656 770 884 998 1112 1246 1378 1492 1606 1720 1834 1948 2062 2188 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2682 -2134 -2010 -1894 -1780 -1666 -1552 -1438 -1318 -1066 -952 -838 -724 -610 -496 -382 -268 -154 -40 74 188 302 416 530 644
PIN No.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
Name
P37 DVCC2 P20 DVSS5 P21 P22 P23 P24 P25 P26 P27 PZ0 PZ1 PZ2 PZ3 P56 P60 P61 P62 DVSS6 P63 P64 P65 P66 P67 P70 P71 P72 DVCC3 P73 P74 P75 P76 P77 PD6 PD7 PF3 PF4 PF5 DVSS7 PF6 PF7 P90 P91
NMI
X Point
2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2736 2188 2062 1948 1834 1720 1606 1492 1378 1264 1150 1036 922 808 694 580 382 268 68 -46 -160 -274 -388 -520 -634 -748 -862 -976 -1090 -1204 -1318 -1432 -1546 -1660 -1954 -2068 -2194
Y Point
758 872 986 1202 1318 1432 1546 1660 1774 1888 2004 2128 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676 2676
VREFL VREFH P80
XT1
91C820A-6
2006-01-31
TMP91C820A
2.3
Pin Names and Functions
The names of the input/output pins and their functions are described below. Table 2.3.1 Pin Names and Functions (1/4)
Pin Name
P00 to P07 D0 to D7 P10 to P17 D8 to D15 P20 to P27 A16 to A23 P30 to P37 A8 to A15 P40 o P47 A0 to A7 PZ0
RD
Number of Pins
8 8
I/O
I/O I/O I/O I/O
Functions
Port 0: I/O port that allows I/O to be selected at the bit level Data (Lower): Bits 0 to 7 of data bus Port 1: I/O port that allows I/O to be selected at the bit level (When used to the external 8-bit bus) Data (Upper): Bits 8 to15 of data bus Port 2: I/O port Address: Bits 16 to 23 of address bus Port 3: I/O port Address: Bits 8 to 15 of address bus Port 4: I/O port Address: Bits 0 to 7 of address bus Port Z0: Output port Read: Strobe signal for reading external memory Port Z1: Output port Write: Strobe signal for writing data to pins D0 to D7 Port Z2: I/O port (with pull-up resistor) High write: Strobe signal for writing data to pins D8 to D15 Port Z3: I/O port (with pull-up resistor) Read/write: 1 represents read or dummy cycle; 0 represents write cycle. Write for SRAM: Strobe signal for writing data. Port 56: I/O port (with pull-up resistor) Wait: Pin used to request CPU bus wait Port 60: Output port Chip select 0: Outputs 0 when address is within specified address area. Port 61: Output port Chip select 1: Outputs 0 when address is within specified address area Chip select for SDRAM: Outputs 0 when address is within SDRAM address area Port 62: Output port Chip select 2: Outputs 0 when address is within specified address area Expand chip select 2A: Outputs 0 when address is within specified address area Port 63: Output port Chip select 3: Outputs 0 when address is within specified address area Port 64: Output port Chip select 24: Outputs 0 when address is within specified address area Expand chip select 2B: Outputs 0 when address is within specified address area Port 65: Output port Chip select 25: Outputs 0 when address is within specified address area Expand chip select 2C: Outputs 0 when address is within specified address area Port 66: Output port Expand chip select 2D: Outputs 0 when address is within specified address area Lower byte enable for SRAM: Outputs 0 when lower data is enable. Port 67: Output port Expand chip select 2E: Outputs 0 when address is within specified address area Upper byte enable for SRAM: Outputs 0 when upper data is enable.
8 8 8 1 1 1 1
Output Output Output Output Output Output Output Output Output Output I/O Output I/O Output Output
PZ1
WR
PZ2
HWR
PZ3 R/ W
SRWR
P56
WAIT
1 1 1
I/O Input Output Output Output Output Output
P60
CS0
P61
CS1 SDCS
P62
CS2 CS2A
1
Output Output Output
P63
CS3
1 1
Output Output Output Output Output
P64 EA24
CS2B
P65 EA25
CS2C
1
Output Output Output
P66
CS2D SRLB
1
Output Output Output
P67
CS2E SRUB
1
Output Output Output
91C820A-7
2006-01-31
TMP91C820A
Table 2.3.2 Pin Names and Functions (2/4) Pin Name
P70 SCK OPTRX0 P71 S0 SDA OPTRX0 P72 SI SCL P73
CS2F
Number of Pins
1
I/O
I/O I/O Input Port 70: I/O port
Functions
Serial bus interface clock I/O data at SIO mode Serial 0 recive data Port 71: I/O port Serial bus interface send data at SIO mode Serial bus interface send/recive data at I C bus mode (Open-drain output mode by programmable) Serial 0 send data Port 72: I/O port Serial bus interface recive data at SIO mode Serial bus interface clock I/O data at I C bus mode (Open-drain output mode by programmable) Port 73: I/O port Expand chip select 2F: Outputs 0 when address is within specified address area Port 74: I/O port Expand chip select 2G: Outputs 0 when address is within specified address area Port 75: I/O port Expand chip select EXA: Outputs 0 when address is within specified address area Port 76: I/O port Mask: Use for disable to output VEECLK for LCD driver Port 77: I/O port Output 32.768 kHz clock to LCD driver. (Can be disabled by MSK pin.) Port 80 to 87: Pin used to input ports Analog input 0 to 7: Pin used to input to AD conveter AD trigger: Signal used to request AD start (with used to P83) Port 90 to 97: Pin used to input ports Key input 0 to 7: Pin used of key-on wakeup 0 to 7 (Schmitt input, with pull-up resistor) Port A0 to A7: Pin used to output ports Key output 0 to 7: Pin used of key-scan strobe 0 to 7 Port B0: I/O port 8-bit timer 0 input: Timer 0 input Serial 2 send data: Open-drain output pin by programmable Port B1: I/O port 8-bit timer 1 output: Timer 1 output Serial 2 receive data Port B3: I/O port Interrupt request pin0: Interrupt request pin with programmable level/rising/falling edge Port B4: I/O port Interrupt request pin1: Interrupt request pin with programmable rising/falling edge
2 2
1
I/O Output I/O Output
1
I/O Input I/O
1 1 1
I/O Output I/O Output I/O Output
P74
CS2G
P75
CSEXA
P76 MSK P77 VEECLK P80 to P87 AN0 to AN7
ADTRG
1 1 8
I/O Input I/O Output Input Input Input
P90 to P97 KI0 to KI7 PA0 to PA7 KO0 to KO7 PB0 TA0IN TXD2 PB1 TA1OUT RXD2 PB3 INT0 PB4 INT1
8
Input Input
8 1
Output Output I/O Input Output
1
I/O Output Input
1
I/O Input
1
I/O Input
91C820A-8
2006-01-31
TMP91C820A
Table 2.3.3 Pin Names and Functions (3/4) Pin Name
PB5 INT2 TA3OUT PB6 INT3 TB0OUT0 PC0 TXD0 PC1 RXD0 PC2 SCLK0
CTS0
Number of Pins
1
I/O
I/O Input Output Port B5: I/O port
Functions
Interrupt request pin2: Interrupt request pin with programmable rising/falling edge 8-bit timer 3 output: Timer 3 output Port B6: I/O port Interrupt request pin3: Interrupt request pin with programmable rising/falling edge Timer B0 output Port C0: I/O port Serial 0 send data: Open-drain output pin by programmable Port C1: I/O port Serial 0 receive data Port C2: I/O port Serial 0 clock I/O Serial 0 data send enable (Clear to send) Port C3: I/O port Serial 1 send data (Open-drain output pin by programmable) Port C4: I/O port Serial 1 receive data Port C5: I/O port Serial 1 clock I/O Serial 1 data send enable (Clear to send) Port D0: Output port LCD driver output pin Port D1: Output port LCD driver output pin Port D2: Output port LCD driver output pin Port D3: Output port LCD driver output pin Port D4: Output port LCD driver output pin Port D6: Output port RTC alarm output pin Melody/alarm output pin (Inverted) Port D7: Output port Melody/alarm output pin Port E0 to E7: I/O port Data bus for LCD driver Port F0: Output port Row address storobe for SDRAM: Outputs 0 when address is within SDRAM address area Port F1: Output port Column address storobe for SDRAM: Outputs 0 when address is within SDRAM address area
1
I/O Input Outout
1 1 1
I/O Output I/O Input I/O I/O Input
PC3 TXD1 PC4 RXD1 PC5 SCLK1
CTS1
1 1 1
I/O Output I/O Input I/O I/O Input
PD0 D1BSCP PD1 D2BLP PD2 D3BFR PD3 DLEBCD PD4 DOFFB PD6
ALARM MLDALM
1 1 1 1 1 1
Output Output Output Output Output Output Output Output Output Output Output Output Output
PD7 MLDALM PE0 to PE7 LD0 to LD7 PF0
SDRAS
1 8 1
Output Output I/O Output I/O Output
PF1
SDCAS
1
I/O Output
91C820A-9
2006-01-31
TMP91C820A
Table 2.3.4 Pin Names and Functions (4/4) Pin Name
PF2
SDWE
Number of Pins
1 1 1 1 1 1 1
I/O
Output Output Output Output Output Output Output Output Output Output Output Input Input Port F2: Output port Write enable for SDRAM Port F3: Output port Lower data enable for SDRAM Port F4: Output port Upper data enable for SDRAM Port F5: Output port Clock enable for SDRAM Port F6: Output port Clock for SDRAM Port F7: Output port
Functions
PF3 SDLDQM PF4 SDUDQM PF5 SDCKE PF6 SDCLK PF7
PS NMI
Power save mode setting terminal Non-maskable interrupt request: Interrupt request pin with programmable falling edge level or with both edge levels programmable Operation mode: Fixed to AM1 = 1, AM0 = 1 when using internal ROM (when ROM code is 9999, setting is prohibitted). Fixed to AM1 = 0, AM0 = 1 when using external ROM by 16-bit external bus, or 8or 16-bit dynamic sizing. Fixed to AM1 = 0, AM0 = 0 when using external ROM by 8-bit external bus.
(Note) AM0 to AM1 2 Input
EMU0 EMU1
RESET
1 1 1 1 1 2 2 1 1 3 7
Output Output Input Input Input I/O I/O
Open pin Open pin Reset: Initializes TMP91C820A (with pull-up resistor). Pin for reference voltage input to AD converter (H) Pin for reference voltage input to AD converter (L) High-frequency oscillator connection pins Low-frequency oscillator connection pins Power supply pin for AD converter GND pin for AD converter (0 V) Power supply pins (All VCC pins should be connecyed with the power supply pin). GND pins (All pins should be connected with GND (0 V).)
VREFH VREFL X1/X2 XT1/XT2 AVCC AVSS DVCC DVSS
Note: Please input 1 into NMI / PS pin, because NMI / PS = 0 means power save mode after reset.
91C820A-10
2006-01-31
TMP91C820A
3.
Operation
This following describes block by block the functions and operation of the TMP91C820A. Notes and restrictions for eatch book are outlined in 6 "Points of Note and Restrictions" at the end of this manual.
3.1
CPU
The TMP91C820A incorporates a high-performance 16-bit CPU (The 900/L1 CPU). For CPU operation, see the "TLCS-900/L1 CPU". The following describe the unique function of the CPU used in the TMP91C820A; these functions are not covered in the TLCS-900/L1 CPU section.
3.1.1
Reset
When resetting the TMP91C820A microcontroller, ensure that the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then hold the RESET input to low level for at least 10 system clocks (9s at 36MHz). Thus, when turn on the switch, be set to the power supply voltage is within the operating voltage range, and that the internal high-frequency oscillator has stabilized. Then hold the RESET input to low level at least for 10 system clocks. Clock gear is initialized 1/16 mode by reset operation. It means that the system clock mode fSYS is set to fc/32 (= fc/16 x 1/2). When the reset is accept, the CPU: * Sets as follows the program counter (PC) in accordance with the reset vector stored at address FFFF00H to FFFF02H: PC<7:0> PC<15:8> * * * * Value at FFFF00H address Value at FFFF01H address
PC<23:16> Value at FFFF02H address Sets the stack pointer (XSP) to 100H. Sets bits of the status register (SR) to 111 (Sets the interrupt level mark register to level 7). Sets the bit of the status register to 1 (MAX mode). (Note: As this product does not support MIN mode, do not write a 0 to the .) Clears bits of the status register to 000 (Sets the register bank to 0).
When reset is released,the CPU starts executing instructions in accordance with the program counter settings. CPU internal registers not mentioned above do not change when the reset is released. When the reset is accepted, the CPU sets internal I/O, ports, and other pins as follows. Initializes the internal I/O registers. Sets the port pins, including the pins that also act as internal I/O, to general-purpose input or output port mode.
Note:
The CPU internal register (except to PC, SR, XSP) and internal RAM data do not change by resetting.
Figure 3.1.1 is a reset timing of the TMP91C820A-9999.
91C820A-11
2006-01-31
fFPH Sampling Sampling
RESET
A23 to A0
0FFFF00H
CS0, CS1, CS3
CS2
D0 to D15
Data-in
Data-in
Read
RD
(After reset released, startting 2 waits read cycle)
Figure 3.1.1 TMP91C820A-9999 Reset Timing Example (The case of using external ROM)
Data-out
91C820A-12
(PZ2 input mode)
D0 to D15
WR
Write
HWR
XT1, XT2
: Pull up (Internal) : High-Z
TMP91C820A
2006-01-31
TMP91C820A
3.2
Memory Map
Figure 3.2.1 is a memory map of the TMP91C820A.
000000H Internal I/O (4 Kbytes) 000100H 000FE0H 001000H Internal RAM (8 Kbytes) 003000H Direct area(n)
64-Kbyte area (nn)
010000H
External memory
FFE000H Mask ROM (8 Kbytes)
FFFF00H FFFFFFH Vector table (256 bytes)
16-Mbyte area (R) (-R) (R+) (R + R8/16) (R + d8/16) (nnn)
(
= Internal area)
Figure 3.2.1 Memory Map Note: Address 000FE0H to 000FFFH is assigned for the external memory area of built-in RAM type LCD driver. And when ROM code is 9999, internal mask ROM area also defines external memory area.
91C820A-13
2006-01-31
TMP91C820A
3.3
Triple Clock Function and Standby Function
TMP91C820A contains (1) Clock gear, (2) Clock doubler (DFM), (3) Standby controller, and (4) Noise-reducing circuit. It is used for low-power, low-noise systems. This chapter is organized as follows: 3.3.1 Block Diagram of System Clock 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 SFRs System Clock Controller Prescaler Clock Controller Clock Doubler (DFM) Noise Reduction Circuits Standby Controller
91C820A-14
2006-01-31
TMP91C820A
The clock operating modes are as follows: (a) Single clock mode (X1, X2 pins only), (b) Dual clock mode (X1, X2, XT1 and XT2 pins) and (c) Triple clock mode (The X1, X2, XT1 and XT2 pins and DFM). Figure 3.3.1 shows a transition figure.
Reset (fOSCH/32) IDLE2 mode (I/O operate) IDLE1 mode (Operate only oscillator) Instruction Interrupt Instruction Interrupt (a) Release reset
NORMAL mode (fOSCH/gear value/2)
Instruction Interrupt
STOP mode (Stops all circuits)
Single clock mode transition figure Reset (fOSCH/32)
IDLE2 mode (I/O operate) IDLE1 mode (Operate only oscillator) IDLE2 mode (I/O operate) IDLE1 mode (Operate only oscillator)
Instruction Interrupt Instruction Interrupt Instruction Interrupt Instruction Interrupt (b)
Release reset
NORMAL mode (fOSCH/gear value/2)
Instruction Interrupt STOP mode (Stops all circuits)
Instruction SLOW mode (fs/2) Dual clock mode transition fiigure Reset (fOSCH/32)
IDLE2 mode (I/O operate) IDLE1 mode (Operate only oscillator)
Instruction Interrupt Instruction Interrupt
Release reset
NORMAL mode (fOSCH/gear value/2)
Instruction *Note
Interrupt Instruction Interrupt SLOW mode (fs/2)
STOP mode (Stops all circuits) Instruction Instruction *Note
IDLE2 mode (I/O operate)
Instruction Interrupt
Instruction
Instruction Interrupt
Instruction
IDLE1 mode Instruction (Operate oscillator and DFM) Interrupt
NORMAL mode (4 x fOSCH/gear value/2)
IDLE2 mode (I/O operate) IDLE1 mode (Operate only oscillator)
Using DFM (c) Triple clock mode transition figure
Interrupt
Note 1: It's prohibited to control DFM in SLOW mode when shifting from SLOW mode to NORMAL mode with use of DFM. (DFM start up/stop/change write to DFMCR0 register.) Note 2: If you shift from NORMAL mode with use of DFM to NORMAL mode, the instruction should be separated into two procedures as below. Change CPU clock Stop DFM circuit. Note 3: It's prohibited to shift from NORMAL mode with use of DFM to STOP mode directly. You should set NORMAL mode once, and then shift to STOP mode. (You should stop high frequency oscillator after you stop DFM.)
Figure 3.3.1 System Clock Block Diagram
The clock frequency input from the X1 and X2 pins is called fc and the clock frequency input from the XT1 and XT2 pins is called fs. The clock frequency selected by SYSCR1 is called the system clock fFPH. The system clock fSYS is defined as the divided clock of fFPH, and one cycle of fSYS is defined to as one state.
91C820A-15
2006-01-31
TMP91C820A 3.3.1 Block Diagram of System Clock
SYSCR0 SYSCR2 DFMCR0 Warm-up timer (High-/low-frequency oscillator), lockup timer (DFM) SYSCR0 T T0 fc/16 fFPH /2 /4 fs fs fc fDFM = fOSCH x 4 Clock doubler (DFM) Selector fc/2 fc/4 fc/8
fc/16
SYSCR0 XT1 XT2 Low-frequency oscillator
/2
fSYS
SYSCR0 X1 X2 High-frequency oscillator fOSCH
SYSCR1
/2 /4 /8 /16 Clock gear
SYSCR1
DFMCR0 fSYS TMRA0 to TMRA3,TMRB0 T0
Prescaler
CPU RAM Interrupt controller SIO0 to 2 ADC
Prescaler
WDT SBI T
Prescaler
I/O ports SDRAMC ROM
RTC fs LCDC
MLD/ALM
Figure 3.3.2 Block Diagram of System Clock
91C820A-16
2006-01-31
TMP91C820A 3.3.2 SFRs
7
SYSCR0 Bit symbol (00E0H) Read/Write After reset Function XEN 1
6
XTEN 1
5
RXEN 1
4
RXTEN 0
Lowfrequency oscillator (fs) after release of STOP mode
3
RSYSCK R/W 0
2
WUEF 0
1
PRCK1 0
00: fFPH (Note 2) 01: Reserved 10: fc/16 11: Reserved
0
PRCK0 0
HighLowHighfrequency frequency frequency oscillator (fc) oscillator (fs) oscillator (fc) after release 0: Stop 0: Stop 1: Oscillation 1: Oscillation of STOP mode
(Note 1)
Selects clock Warm-up after release timer of STOP 0: Write mode don't 0: fc care 1: fs 1: Write 0: Stop 0: Stop start 1: Oscillation 1: Oscillation timer 0: Read end warm up 1: Read do not end warm up
Select prescaler clock
7 SYSCR1 Bit symbol (00E1H) Read/Write After reset Function
6
5
4
3 SYSCK 0
Select system clock 0: fc 1: fs
2 GEAR2 R/W 1
1 GEAR1 0
0 GEAR0 0
Select gear value of high frequency (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved)
7 SYSCR2 Bit symbol (00E2H) Read/Write After reset Function PSENV R/W 0 1:Disable 0:Power save mode enable
(Note 3)
6
5 WUPTM1 R/W 1
4 WUPTM0 R/W 0
3 HALTM1 R/W 1
HALT mode 00: Reserved 01: STOP mode 10: IDLE1 mode 11: IDLE2 mode
2 HALTM0 R/W 1
1 SELDRV R/W 0 mode select
1: STOP 0: IDLE1 (Note 4)
0 DRVE R/W 0
Pin state control in STOP/IDLE1 mode 0: I/O off 1: Remains the state before halt
Warm-up timer 00: Reserved 01: 28 inputted frequency 10:214 11:216
Note 1: Note 2: Note 3: Note 4:
By reset, low-frequency oscillator is enabled. It's prohibit to use to fc/16 prescaler clock when SBI block use. (I C bus and clock synchronous.) When use NMI / PS pin as NMI function, set to 1. 0 means IDLE1, and 1 means STOP. Please be careful because this setting is sometimes different from others.
2
Figure 3.3.3 SFR for System Clock
91C820A-17
2006-01-31
TMP91C820A
Symbol Name
Address
7
ACT1 R/W 0
6
ACT0 R/W 0
LUP
5
DLUPFG R 0
4
DLUPTM R/W 0 Lockup time 0: 212/fOSCH
3
2
1
0
DFM DFMCR0 control register 0 E8H
DFM
select Lockup fFPH status flag
00 STOP STOP fOSCH 01 RUN RUN f
OSCH
0: End
10 1: Not end 1: 2 /fOSCH
10 RUN STOP 11 RUN STOP D7 DFM DFMCR1 control register 1 E9H R/W 0
fDFM fOSCH
D6 R/W 0
D5 R/W 0
D4 R/W 1
D3 R/W 0
D2 R/W 0
D1 R/W 1
D0 R/W 1
DFM revision Input frequency 4 to 9 MHz (at 2.7 V to 3.6 V): Write 0BH
Figure 3.3.4 SFR for DFM
Limitation point on the use of DFM 1. It's prohibited to execute DFM enable/disable control in the SLOW mode (fs) (Write to DFMCR0 = "10"). You should control DFM in the NORMAL mode. If you stop DFM operation during using DFM (DFMCR0 = "10"), you shouldn't execute that change the clock fDFM to fOSCH and stop the DFM at the same time. Therefore the above executions should be separated into two procedures as showing below.
LD LD (DFMCR0), C0H (DFMCR0), 00H ; ; Change the clock fDFM to fOSCH. DFM stop.
2.
3.
If you stop high-frequency oscillator during using DFM (DFMCR0 = "10"), you should stop DFM before you stop high-frequency oscillator.
Please refer to 3.3.5 "Clock Doubler (DFM)" for the details.
91C820A-18
2006-01-31
TMP91C820A
7
EMCCR0 (00E3H) Bit symbol Read/Write After reset Function R 0
Protect flag 0: OFF 1: ON
6
R/W 0
LCDC
5
AHOLD R/W 0
4
TA3MLDE R/W 0
3
- R/W 0
2
EXTIN R/W 0
1
DRVOSCH
0
DRVOSCL
PROTECT TA3LCDE
R/W 1
fc oscillator driver ability 1: Normal 0: Weak
R/W 1
fs oscillator driver ability 1: Normal 0: Weak
Address Source clock hold (Note) 0: 32 kHz 0: Disable 1: TA3OUT 1: Enable
Melody/alarm Always write 1: External source clock "0". clock 0: 32 kHz 1: TA3OUT
Bit symbol EMCCR1 (00E4H) Read/Write After reset Function EMCCR2 (00E5H) Bit symbol Read/Write After reset Function EMCCR3 (00E6H) Bit symbol Read/Write After reset Function ENFROM R/W 0
CS1A area detect control 0: Disable 1: Enable
Switching the protect ON/OFF by write to following 1st-KEY, 2nd-KEY 1st-KEY: EMCCR1 = 5AH, EMCCR2 = A5H in succession write 2nd-KEY: EMCCR1 = A5H, EMCCR2 = 5AH in succession write
ENDROM R/W 0
CS2B 2G area detect control 0: Disable 1: Enable
ENPROM R/W 0
CS2A area detect control 0: Disable 1: Enable
FFLAG R/W 0
CS1A write operation flag
DFLAG
PFLAG
R/W 0
CS2B 2G write operation flag
R/W 0
CS2A write operation flag
When reading 0: Not written 1: Written When writing 0: Clear flag
Note1: When getting access to the logic address 000000H to 000FDFH, 001000H to 002FFFH and FFE000H to FFFFFFH, A0 to A23 holds the previous address of external access. Note2: In case restarting the oscillator in the stop oscillation state (e.g. Restart the oscillator in STOP mode), set EMCCR0, ="1".
Figure 3.3.5 SFR for Noise Reducing
91C820A-19
2006-01-31
TMP91C820A 3.3.3 System Clock Controller
The system clock controller generates the system clock signal (fSYS) for the CPU core and internal I/O. It contains two oscillation circuits and a clock gear circuit for high-frequency (fc) operation. The register SYSCR1 changes the system clock to either fc or fs, SYSCR0 and SYSCR0 control enabling and disabling of each oscillator, and SYSCR1 sets the high-frequency clock gear to either 1, 2, 4, 8 or 16 (fc, fc/2, fc/4, fc/8 or fc/16). These functions can reduce the power consumption of the equipment in which the device is installed. The combination of settings = 1, = 0, = 0 and = 100 will cause the system clock (fSYS) to be set to fc/32 (fc/16 x 1/2) after a reset. For example, fSYS is set to 1.1 MHz when the 36-MHz oscillator is connected to the X1 and X2 pins. (1) Switching from NORMAL mode to SLOW mode When the resonator is connected to the X1 and X2 pins, or to the XT1 and XT2 pins, the warm-up timer can be used to change the operation frequency after stable oscillation has been attained. The warm-up time can be selected using SYSCR2. This warm-up timer can be programmed to start and stop as shown in the following examples 1 and 2. Table 3.3.1 shows the warm-up times.
Note 1: When using an oscillator (Other than a resonator) with stable oscillation, a warm-up timer is not needed. Note 2: The warm-up timer is operated by an oscillation clock. Hence, there may be some variation in warm-up time.
Table 3.3.1 Warm-up Times Warm-up Time SYSCR2
01 (2 /frequency) 10 (2 /frequency) 11 (2 /frequency)
16 14 8
Change to NORMAL Mode
7.1 [s]
Change to SLOW Mode
7.8 500 2000 [ms] [ms] [ms]
at fOSCH = 36 MHz, fs = 32.768 kHz
0.455 [ms] 1.820 [ms]
91C820A-20
2006-01-31
TMP91C820A
Example 1: SYSCR0 SYSCR1 SYSCR2
Setting the clock Changing from high frequency (fc) to low frequency (fs). EQU EQU EQU LD SET SET 00E0H 00E1H 00E2H (SYSCR2), -X11- - - -B 6, (SYSCR0) 2, (SYSCR0) 2, (SYSCR0) NZ, WUP 3, (SYSCR1) 7, (SYSCR0) ; ; ; ; ; ; ; Sets warm-up time to 2 /fs. Enables low-frequency oscillation. Clears and starts warm-up timer. Detects stopping of warm-up timer. Changes fSYS from fc to fs. Disables high-frequency oscillation.
16
WUP:
BIT JR SET RES
X: Don't care, -: No change
X1, X2 pins XT1, XT2 pins
Warm-up timer End of warm-up timer System clock fSYS
Counts up by fSYS
Counts up by fs
fc
fs
Enables low frequency
Clears and starts warm-up timer
Chages fSYS from fc to fs End of warm-up timer
Disables high frequency
91C820A-21
2006-01-31
TMP91C820A
Example 2: SYSCR0 SYSCR1 SYSCR2
Setting the clock Changing from low frequency (fs) to high frequency (fc). EQU EQU EQU LD SET SET 00E0H 00E1H 00E2H (SYSCR2), -X10- - - -B 7, (SYSCR0) 2, (SYSCR0) 2, (SYSCR0) NZ, WUP 3, (SYSCR1) 6, (SYSCR0) ; ; ; ; ; ; ; Sets warm-up time to 2 /fc. Enables high-frequency oscillation. Clears and starts warm-up timer. Detects stopping of warm-up timer. Changes fSYS from fs to fc. Disables low-frequency oscillation.
14
WUP:
BIT JR RES RES
X: Don't care, -: No change
X1, X2 pins XT1, XT2 pins
Warm-up timer End of warm-up timer System clock fSYS
Counts up by fSYS
Counts up by fOSCH
fs
fc
Enables high frequency
Clears and starts warm-up timer
Chages fSYS from fs to fc End of warm-up timer Disables low frequency
91C820A-22
2006-01-31
TMP91C820A
(2) Clock gear controller When the high-frequency clock fc is selected by setting SYSCR1 = 0, fFPH is set according to the contents of the clock gear select register SYSCR1 to either fc, fc/2, fc/4, fc/8 or fc/16. Using the clock gear to select a lower value of fFPH reduces power consumption.
Example 3: SYSCR1 Changing to a high-frequency gear EQU LD LD X: Don't care 00E1H (SYSCR1), XXXX0000B (SYSCR1), XXXX0100B ; ; Changes fSYS to fc/2. Changes fSYS to fc/32.
(High-speed clock gear changing) To change the clock gear, write the register value to the SYSCR1 register. It is necessary the warm-up time until changing after writing the register value. There is the possibility that the instruction next to the clock gear changing instruction is executed by the clock gear before changing. To execute the instruction next to the clock gear switching instruction by the clock gear after changing,input the dummy instruction as follows (Instruction to execute the write cycle).
(Example) SYSCR1 EQU LD LD 00E1H (SYSCR1), XXXX0001B (DUMMY), 00H ; ; Changes fSYS to fc/4. Dummy instruction.
Instruction to be executed after clock gear has changed.
91C820A-23
2006-01-31
TMP91C820A 3.3.4 Prescaler Clock Controller
For the internal I/O (TMRA01 to TMRA23, SIO0 to SIO1,SBI) there is a prescaler which can divide the clock. The T clock input to the prescaler is either the clock fFPH divided by 2 or the clock fc/16 divided by 2. The setting of the SYSCR0 register determines which clock signal is input. When it's used internal SBI circuit, register must be set to 00.
3.3.5
Clock Doubler (DFM)
DFM outputs the fDFM clock signal, which is four times as fast as fOSCH. It can use the low-frequency oscillator, even though the internal clock is high frequency. A reset initializes DFM to stop status, setting to DFMCR0 register is needed before use. Like an oscillator, this circuit requires time to stabilize. This is called the lockup time. The following example shows how DFM is used.
DFMCR0 DFMCR1 EQU EQU LD LD LUP: BIT JR LD X: Don't care 00E8H 00E9H (DFMCR1), 0BH (DFMCR0), 01X0XXXXB 5, (DFMCR0) NZ, LUP (DFMCR0), 10X0XXXXB ; ; ; ; ; Parameter setting. Set lockup time to 2 /4 MHz. Enables DFM operation and starts lockup. Detects end of lockup. Changes fc from 4 MHz to 16 MHz.
12
ACT1 to ACT0 DFM output: fDFM Lockup timer System clock fSYS
01
10
Counts up by fOSCH
During lockup
After lockup
Starts DFM operation. Starts lockup.
Changes from 4 MHz to 16 MHz. Ends of lockup
Note: Input frequency limitation and correction for DFM. Recommend to use input frequency (High-speed oscillation) for DFM in the following condition. fOSCH = 4 MHz to 9 MHz (Vcc = 2.7 V to 3.6 V): Write 0BH to DFMCR1.
91C820A-24
2006-01-31
TMP91C820A
Limitation point on the use of DFM 1. It's prohibited to execute DFM enable/disable control in the SLOW mode (fs) (Write to DFMCR0 = "10"). You should control DFM in the NORMAL mode. If you stop DFM operation during using DFM (DFMCR0 = "10"), you shouldn't execute the commands that change the clock fDFM to fOSCH and stop the DFM at the same time. Therefore the above execution should be separated into two procedures as showing below.
LD LD (DFMCR0), C0H (DFMCR0), 00H ; ; Change the clock fDFM to fOSCH. DFM stop.
2.
3.
If you stop high-frequency oscillator during using DFM (DFMCR0 = "10"), you should stop DFM before you stop high-frequency oscillator. Examples of settings are below. (1) Start up/change control (OK) Low-frequency oscillator operation mode (fs) (high-frequency oscillator stop) High-frequency oscillator start up High-frequency oscillator operation mode (fOSCH)
DFM start up DFM use mode (fDFM)
WUP: LD BIT JR LD LD BIT JR LD (SYSCR0), 11- - -1- -B 2, (SYSCR0) NZ, WUP (SYSCR1), - - - -0- - -B (DFMCR0), 01-0- - - -B 5, (DFMCR0) NZ, LUP (DFMCR0), 10-0- - - -B ; ; ; ; ; ; ; ; High-frequency oscillator start-up/warm-up start. Check for the flag of lockup end. Change the system clock fS to fOSCH. DFM start-up/lockup start. Check for the flag of lockup end. Change the system clock.
LUP:
(OK) Low-frequency oscillator operation mode (fs) (high-frequency oscillator operate) High-frequency oscillator operation mode (fOSCH) DFM start up DFM use mode (fDFM)
LD LD BIT JR LD (SYSCR1), - - - -0- - -B (DFMCR0), 01-0- - - -B 5, (DFMCR0) NZ, LUP (DFMCR0), 10-0- - - -B ; ; ; ; ; Change the system clock fs to fOSCH. DFM start-up/lockup start. Check for the flag of lockup end. Change the system clock fOSCH to fDFM.
LUP:
(Error) Low-frequency oscillator operation mode (fs) (High-frequency oscillator stop) High-frequency oscillator start up DFM start up DFM use mode (fDFM)
WUP: LD BIT JR LD BIT JR LD LD (SYSCR0), 11- - -1- -B 2, (SYSCR0) NZ, WUP (DFMCR0), 01-0- - - -B 5, (DFMCR0) NZ, LUP (DFMCR0), 10-0- - - -B (SYSCR1), - - - -0- - -B ; ; ; ; ; ; ; ; High-frequency oscillator start-up/warm-up start. Check for the flag of lockup end. DFM start-up/lockup start. Check for the flag of lockup end. Change the internal clock fOSCH to fDFM. Change the system clock fS to fDFM.
LUP:
91C820A-25
2006-01-31
TMP91C820A
(2) Change/stop control (OK) DFM use mode (fDFM) High-frequency oscillator operation mode (fOSCH) DFM stop Low-frequency oscillator operation mode (fs) High-frequency oscillator stop
LD LD LD LD (DFMCR0), 11- - - - - -B (DFMCR0), 00- - - - - -B (SYSCR1), - - - -1- - -B (SYSCR0), 0- - - - - - -B ; ; ; ; Change the system clock fDFM to fOSCH. DFM stop. Change the system clock fOSCH to fs. High-frequency oscillator stop.
(Error) DFM use mode (fDFM) Low-frequency oscillator operation mode (fs) DFM stop High-frequency oscillator stop
LD LD LD LD (SYSCR1), - - - -1- - -B (DFMCR0), 11- - - - - -B (DFMCR0), 00- - - - - -B (SYSCR0), 0- - - - - - -B ; ; ; ; Change the system clock fDFM to fs. Change the internal clock (fc) fDFM to fOSCH. DFM stop. High-frequency oscillator stop.
(OK) DFM use mode (fDFM) Set the STOP mode High-frequency oscillator operation mode (fOSCH) DFM stop Halt (High-frequency oscillator stop)
LD LD LD HALT (SYSCR2), - - - -01- -B (DFMCR0), 11- - - - - -B (DFMCR0), 00- - - - - -B ; ; ; ; Set the STOP mode. (This command can execute before use of DFM.) Change the system clock fDFM to fOSCH. DFM stop. Shift to STOP mode.
(Error) DFM use mode (fDFM) Set the STOP mode Halt (High-frequency oscillator stop)
LD HALT (SYSCR2), - - - -01- -B ; ; Set the STOP mode. (This command can execute before use of DFM.) Shift to STOP mode.
91C820A-26
2006-01-31
TMP91C820A 3.3.6 Noise Reduction Circuits
Noise reduction circuits are built in, allowing implementation of the following features. (1) Reduced drivability for high-frequency oscillator (2) Reduced drivability for low-frequency oscillator (3) Single drive for high-frequency oscillator (4) Runaway provision with SFR protection register (5) Runaway provision with ROM protection register The above functions are performed by making the appropriate settings in the EMCCR0 to EMCCR3 registers. (1) Reduced drivability for high-frequency oscillator (Purpose) Reduces noise and power for oscillator when a resonator is used. (Block diagram)
fOSCH C1 Resonator C2 X2 pin X1 pin Enable oscillation (STOP + EMCCR0) EMCCR0
(Setting method) The drivability of the oscillator is reduced by writing 0 to EMCCR0 register. By reset, is initialized to 1 and the oscillator starts oscillation by normal drivability when the power supply is on.
91C820A-27
2006-01-31
TMP91C820A
(2) Reduced drivability for low-frequency oscillator (Purpose) Reduces noise and power for oscillator when a resonator is used. (Block diagram)
XT1 pin Enable oscillation EMCCR0 C2 XT2 pin fs
C1 Resonator
(Setting method) The drivability of the oscillator is reduced by writing 0 to the EMCCR0 register. By reset, is initialized to 1.
(3) Single drive for high-frequency oscillator (Purpose) Not need twin-drive and protect mistake operation by inputted noise to X2 pin when the external oscillator is used. (Block diagram)
fOSCH X1 pin Enable oscillation (STOP + EMCCR0)
EMCCR0
X2 pin
(Setting method) The oscillator is disabled and starts operation as buffer by writing 1 to EMCCR0 register. X2 pin is always outputted 1. By reset, is initialized to 0.
Note: Do not write EMCCR0 = "1" when using external resonator.
91C820A-28
2006-01-31
TMP91C820A
(4) Runaway provision with SFR protection register (Purpose) Provision in runaway of program by noise mixing. Write operation to specified SFR is prohibited so that provision program in runaway prevents that it is it in the state which is fetch impossibility by stopping of clock, memory control register (CS/WAIT controller, MMU) is changed. And error handling in runaway becomes easy by INTP0 interruption. Specified SFR list 1. CS/WAIT controller B0CS, B1CS, B2CS, B3CS, BEXCS, MSAR0, MSAR1, MSAR2, MSAR3, MAMR0, MAMR1, MAMR2, MAMR3 2. 3. 4. MMU LOCAL0/1/2/3 Clock gear SYSCR0, SYSCR1, SYSCR2, EMCCR0, EMCCR3 DFM DFMCR0/1 (Operation explanation) Execute and release of protection (Write operation to specified SFR) become possible by setting up a double key to EMCCR1 and EMCCR2 register. (Double key) 1st-KEY: Succession writes in 5AH at EMCCR1 and A5H at EMCCR2 2nd-KEY: Succession writes in A5H at EMCCR1 and 5AH at EMCCR2 A state of protection can be confirmed by reading EMCCR0. By reset, protection becomes OFF. And INTP0 interruption occurs when write operation to specified SFR was executed with protection on state.
91C820A-29
2006-01-31
TMP91C820A
(5) Runaway provision with ROM protection register (Purpose) Provision in runaway of program by noise mixing. (Operation explanation) When writes operation was executed for external three kinds of ROM by runaway of program, INTP1 is occurred and detects runaway function. Three kinds of ROM is fixed as for flash ROM (Option program ROM), data ROM, program ROM are as follows on the logical address memory map. 1. Flash ROM: Address 400000H to 7FFFFFH 2. Data ROM: Address 800000H to BFFFFFH 3. Program ROM: Address C00000H to FFFFFFH For these address, admission/prohibition of detection of write operation sets it up with EMCCR3. And INTP1 interruption occurred with which ROM area in the case that occurred can confirm each with EMCCR3. This flag is cleared when write in 0.
91C820A-30
2006-01-31
TMP91C820A 3.3.7 Standby Controller
(1) HALT modes When the HALT instruction is executed, the operating mode switches to IDLE2, IDLE1 or STOP mode, depending on the contents of the SYSCR2 register. The subsequent actions performed in each mode are as follows: a. IDLE2: Only the CPU halts. The internal I/O is available to select operation during IDLE2 mode by setting the following register. Table 3.3.2 shows the registers of setting operation during IDLE2 mode.
Table 3.3.2 SFR Setting Operation during IDLE2 Mode Internal I/O
TMRA01 TMRA23 TMRB0 SIO0 SIO1 AD converter WDT SBI
SFR
TA01RUN TA23RUN TB0RUN SC0MOD1 SC1MOD1 ADMOD1 WDMOD SBI0BR0
b. IDLE1: Only the oscillator and the RTC (Real time clock) and MLD continue to operate. c. STOP: All internal circuits stop operating. The operation of each of the different HALT modes is described in Table 3.3.3.
Table 3.3.3 I/O Operation during HALT Modes HALT Mode SYSCR2
CPU I/O ports TMRA,TMRB0 SIO, SBI Block AD converter WDT LCDC, SDRAMC Interrupt controller RTC, MLD Available to select operation block
IDLE2 11
Stop Keep the state when the HALT instruction was executed.
IDLE1 10
STOP 01
Table 3.3.6 and Table 3.3.7
Stop
Operate Operational available
91C820A-31
2006-01-31
TMP91C820A
(2) How to release the HALT mode These halt states can be released by resetting or requesting an interrupt. The halt release sources are determined by the combination between the states of interrupt mask register and the HALT modes. The details for releasing the halt status are shown in Table 3.3.4. Released by requesting an interrupt The operating released from the HALT mode depends on the interrupt enabled status. When the interrupt request level set before executing the halt instruction exceeds the value of interrupt mask register,the interrupt due to the source is processed after releasing the HALT mode, and CPU status executing an instruction that follows the halt instruction. When the interrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, releasing the HALT mode is not executed (in non-maskable interrupts, interrupt processing is processed after releasing the HALT mode regardless of the value of the mask register). However only for INT0 to INT3 and INTKEY and INTRTC, INTALM0 to INTALM4, even if the interrupt request level set before executing the halt instruction is less than the value of the interrupt mask register, releasing the the HALT mode is executed. In this case, interrupt processing, and CPU starts executing the instruction next to the HALT instruction, but the interrupt request flag is held at 1.
Note: Usually, interrupts can release all halt status. However, the interrupts ( NMI , INT0 to INT3, INTKEY, INTRTC, INTALM0 to INTALM4) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 5 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to the HALT mode completely, halt status can be released without difficulty. The priority of this interrupt is compared with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt. *
Releasing by resetting Releasing all halt status is executed by resetting. When the stop mode is released by reset, it is necessry enough resetting time (See Table 3.3.5) to set the operation of the oscillator to be stable. When releasing the HALT mode by resetting, the internal RAM data keeps the state before the HALT instruction is executed. However the other settings contents are initialized. (Releasing due to interrupts keeps the state before the HALT instruction is executed.)
91C820A-32
2006-01-31
TMP91C820A
Table 3.3.4 Source of Halt State Clearance and Halt Clearance Operation Status of Received Interrupt HALT mode
NMI INTWDT
Source of halt state clearance
Interrupt Enabled
(Interrupt level) (Interrupt mask)
Interrupt Disabled
(Interrupt level) < (Interrupt mask)
IDLE2

IDLE1
x x x x x x x
STOP
*1
IDLE2
- -
IDLE1
- -
STOP
- -
x * x x x x x * x x x
1 1
INT0 to INT3 (Note 1) INTALM0 to INTALM4
Interrupt

x x x x

x x x x
*1
x x x x x
INTTA0 to INTTA3, INTTB00 to INTTB01 INTRX0 to INTRX2, TX0 to TX2 INTSS0 to INTSS2 INTAD INTKEY INTRTC INTSBI INTLCD RESET

x x

x x
*1
x x x
Initialize LSI.
: After clearing the HALT mode, CPU starts interrupt processing.
: After clearing the HALT mode, CPU resumes executing starting from instruction following the HALT
instruction. x: It can not be used to release the HALT mode . -: The priority level (Interrupt request level) of non-maskable interrupts is fixed to 7, the highest priority level. There is not this combination type. *1: Releasing the HALT mode is executed after passing the warm-up time. Note: When the HALT mode is cleared by an INT0 interrupt of the level mode in the interrupt enabled status, hold level H until starting interrupt processing. If level L is set before holding level L, interrupt processing is correctly started.
(Example releasing IDLE1 mode) An INT0 interrupt clears the halt state when the device is in IDLE1 mode.
Address 8200H 8203H 8206H 8209H 820BH 820EH INT0
LD LD LD EI LD HALT
(PBFC), 08H (IIMC), 00H (INTE0AD), 06H 5 (SYSCR2), 88H
; Sets PB3 to INT0. ; Selects INT0 interrupt rising edge. ; Sets INT0 interrupt level to 6. ; Sets interrupt level to 5 for CPU. ; Sets HALT mode to IDLE1 mode. ; Halts CPU. INT0 interrupt routine RETI
820FH
LD
XX, XX
91C820A-33
2006-01-31
TMP91C820A
(3) Operation a. IDLE2 mode In IDLE2 mode only specific internal I/O operations, as designated by the IDLE2 setting register, can take place. Instruction execution by the CPU stops. Figure 3.3.6 illustrates an example of the timing for clearance of the IDLE2 mode halt state by an interrupt.
X1 A0 to A23
D0 to D15
RD WR
Data
Data
Interrupt for release
IDLE2 mode
Figure 3.3.6 Timing Chart for IDLE2 Mode Halt State Cleared by Interrupt
b.
IDLE1 mode In IDLE1 mode, only the internal oscillator and the RTC, MLD continue to operate. The system clock in the MCU stops. The pin status in the IDLE1 mode is depended on setting the register SYSCR2.,Table 3.3.6 and Table 3.3.7 summarizes the state of these pins in the IDLE1 mode. In the halt state, the interrupt request is sampled asynchronously with the system clock; however, clearance of the halt state (e.g., restart of operation) is synchronous with it. Figure 3.3.7 illustrates the timing for clearance of the IDLE1 mode halt state by an interrupt.
X1 A0 to A23
D0 to D15
RD WR
Data
Data
Interrupt for release IDLE1 mode
Figure 3.3.7 Timing Chart for IDLE1 Mode Halt State Cleared by Interrupt
91C820A-34
2006-01-31
TMP91C820A
c. STOP mode When STOP mode is selected, all internal circuits stop, including the internal oscillator pin status in STOP mode depends on the settings in the SYSCR2 register. Table 3.3.6, Table 3.3.7 summarizes the state of these pins in STOP mode. After STOP mode has been cleared system clock output starts when the warm-up time has elapsed, in order to allow oscillation to stabilize. After STOP mode has been cleared, either NORMAL mode or SLOW mode can be selected using the SYSCR0 register. Therefore, , and must be set see the sample warm-up times in Table 3.3.5. Figure 3.3.8 illustrates the timing for clearance of the STOP mode halt state by an interrupt.
Warm-up time X1 A0 to A23 D0 to D15
RD
Data
Data
WR
Interrupt for release STOP mode
Figure 3.3.8 Timing Chart for STOP Mode Halt State Cleared by Interrupt
Table 3.3.5 Sample Warm-up Times after Clearance of STOP Mode
at fOSCH = 36 MHz, fs = 32.768 kHz
SYSCR0
0 (fc) 1 (fs)
SYSCR2 01 (2 )
7.1 s 7.8 ms
8
10 (214)
0.455 ms 500 ms
11 (216)
1.820 ms 2000 ms
91C820A-35
2006-01-31
TMP91C820A
(Setting example) The STOP mode is entered when the low frequency operates, and high frequency operates after releasing due to NMI.
Address SYSCR0 SYSCR1 SYSCR2 8FFDH 9000H 9002H 9005H
NMI
EQU EQU EQU LD LD LD HALT
00E0H 00E1H 00E2H (SYSCR1), 08H (SYSCR2), -X1001X1B (SYSCR0), 011000 - -B
; fSYS = fs/2. 14 ; Sets warm-up time to 2 /fOSCH. ; Operates high-frequency after released.
Clears and starts hit warm-up timer (High frequency) End NMI interrupt routine
9006H
LD
XX, XX
RETI
-: No change
Note:
When different modes are used before and after STOP mode as the above mentioned, there is possible to release the HALT mode without changing the operation mode by acceptance of the halt release interrupt request during execution of halt instruction (during 6 state). In the system which accepts the interrupts during execution HALT instruction, set the same operation mode before and after the STOP mode.
91C820A-36
2006-01-31
TMP91C820A
Table 3.3.6 Input buffer state table (1/2)
When the CPU is operating When When Used as Used as function Input Port Pin ON upon port read ON upon external read Input Buffer State In HALT mode In HALT mode(IDLE1/STOP) (IDLE2) Condition A (Note) Condition B (Note) When When When When When When Used Used as Used as Used as Used as Used as as Input function function function Input Port Input Port Port Pin Pin Pin
Port Name
Input Function Name
During Reset
P00-P07
D0-D7
OFF 8bit start: OFF 16bit start: ON Built-in ROM start: ON 8bit start: OFF 16bit start: OFF Built-in ROM start: ON
P10-P17
D8-D15
ON upon external read of LCDC
OFF
OFF
P20-P27 P30-P37
- -
OFF
OFF
P40-P47
-
-
-
-
-
ON
PZ2 (*1) PZ3 (*1) P56 (*1) P70 P71 P72 P73 P74 P75 P76 P77 P80 (*2) P81 (*2) P82 (*2) P83 (*2) P84 (*2) P85 (*2) P86 (*2) P87 (*2) P90 (*1) P91 (*1) P92 (*1) P93 (*1) P94 (*1) P95 (*1) P96 (*1) P97 (*1) PB0 PB1 PB3 PB4 PB5 PB6
- - WAIT SCK, OPTRX0 SDA SI, SCL - - - MSK - - - - ADTRG - - - - KI0 KI1 KI2 KI3 KI4 KI5 KI6 KI7 TA0IN RXD2 INT0 INT1 INT2 INT3
OFF ON ON ON
- -
ON
OFF ON
-
ON ON
-
ON ON
-
ON
-
OFF
-
ON
-
OFF
ON
-
ON upon port read
ON
-
OFF
ON
-
ON
-
OFF
ON ON ON ON ON ON OFF
ON ON ON OFF ON
OFF
ON
OFF
OFF
91C820A-37
2006-01-31
TMP91C820A
Input buffer state table (2/2)
Input Function Name When the CPU is operating When When Used as Used as function Input Port Pin Input Buffer State In HALT mode In HALT mode(IDLE1/STOP) (IDLE2) Condition A (Note) Condition B (Note) When When When When When When Used Used as Used as Used as Used as Used as as Input function function function Input Port Input Port Port Pin Pin Pin ON ON ON OFF
- -
Port Name
During Reset
PB0 PB1 PB3 PB4 PB5 PB6 PC0 PC1 PC2 PC3 PC4 PC5 PE0-PE7 NMI/PS RESET (*1) AM0, AM1 X1, XT1
TA0IN RXD2 INT0 INT1 INT2 INT3 - RXD0 SCLK0, CTS0 - RXD1 SCLK1, CTS1 - -
-
OFF
OFF ON ON
ON
ON
- -
OFF
ON ON ON
-
ON
-
OFF ON
-
OFF
ON
-
ON
ON
-
ON
-
OFF OFF
-
ON
-
OFF
ON
- -
-
ON
-
ON
-
ON
-
IDLE1: ON, STOP: OFF *1: Port having a pull-up/pull-down resistor. *2: AIN input does not cause a current to flow through the buffer.
ON: The buffer is always turned on. A current flows the input buffer if the input pin is not driven. OFF: The buffer is always turned off.
-: No applicable
Note: Condition A/B are as follows. SYSCR2 register setting 0 0 1 1 0 1 0 1 Condition B IDLE1 Condition A HALT mode STOP Condition A Condition B
91C820A-38
2006-01-31
TMP91C820A
Table 3.3.7 Output buffer state table (1/2)
Output Buffer State Port Name Output Function Name When the CPU is operating When When Used as Used as function Output Pin Port ON upon external read In HALT mode (IDLE2) When Used as function Pin OFF When Used as Output Port In HALT mode (IDLE1/STOP) Condition A (Note) Condition B (Note) When When When When Used as Used as Used as Used as function Output function Output Pin Port Pin Port OFF
During Reset
P00-P07 P10-P17 P20-P27 P30-P37
D0-D7 D8-D15 A16-A23 A8-A15 OFF 8bit start: ON 16bit start: ON Built-in ROM start: OFF ON
P40-P47
A0-A7
OFF ON ON ON
PZ0 PZ1 PZ2 PZ3 P56 P60 P61 P62 P63 P64 P65 P66 P67 P70 P71 P72 P73 P74 P75 P76 P77 PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7
RD WR HWR R/W, SRWE - CS0 CS1, SDCS CS2, CS2A CS3 EA24, CS2B EA25, CS2C CS2D, SRLB CS2E, SRUB SCK SO, SDA, OPTTX0 SCL CS2F CS2G CSEXA - VEECLK KO0 KO1 KO2 KO3 KO4 KO5 KO6 KO7
OFF (*1)
- - - -
ON ON ON OFF ON
ON
ON
OFF
ON
OFF
-
-
-
-
ON
ON
OFF
ON
91C820A-39
2006-01-31
TMP91C820A
Output buffer state table (1/2)
Output Buffer State Port Name Output Function Name When the CPU is operating When When Used as Used as function Output Pin Port ON
-
In HALT mode (IDLE2) When Used as function Pin ON
-
During Reset
When Used as Output Port
In HALT mode (IDLE1/STOP) Condition B (Note) Condition A (Note) When When When When Used as Used as Used as Used as function Output function Output Pin Port Pin Port OFF
-
PB0 PB1 PB3 PB4 PB5 PB6 PC0 PC1 PC2 PC3 PC4 PC5 PD0 PD1 PD2 PD3 PD4 PD6 PD7 PE0-7 PF0 PF1 PF2 PF3 PF4 PF5 PF6 X2, XT2
TXD2 TA1OUT - - TA3OUT TB0OUT0 TXD0 - SCLK0 TXD1 - SCLK1 D1BSCP D2BLP D3BFR DLEBCD DOFFB ALARM, MLDALM MLDALM LD0-LD7 SDRAS SDCAS SDWE SDLDQM SDUDQM SDCKE
ON
-
OFF
ON
-
ON
-
OFF
-
ON
-
ON
-
ON
-
OFF
-
ON
-
ON ON
ON
OFF
ON
OFF OFF ON ON ON
ON
ON in self refresh cycle
SDCLK - ON: The buffer is always turned on. OFF: The buffer is always turned off. -: No applicable
OFF
- -
IDLE1: ON, STOP: output "H" level
Note: Condition A/B are as follows. SYSCR2 register setting 0 0 1 1 0 1 0 1 Condition B IDLE1 Condition A HALT mode STOP Condition A Condition B
91C820A-40
2006-01-31
TMP91C820A
3.4
Interrupts
Interrupts are controlled by the CPU interrupt mask register SR and by the built-in interrupt controller. The TMP91C820A has a total of 43 interrupts divided into the following 5 types: * * * Interrupts generated by CPU: 9 sources (Software interrupts, illegal instruction interrupt) Internal interrupts: 28 sources Interrupts on external pins ( NMI and INT0 to INT3, INTKEY): 6 sources
A (Fixed) individual interrupt vector number is assigned to each interrupt. One of six (Variable) priority levels can be assigned to each maskable interrupt. The priority level of non-maskable interrupts is fixed at 7, the highest level. When an interrupt is generated, the interrupt controller sends the piority of that interrupt to the CPU. If multiple interrupts are generated simultaneously,the interrupt controller sends the interrupt with the highest priority to the CPU. (The highest priority possible is level 7, used for non-maskable interrupts.) The CPU compares the priority level of the interrupt with the value of the CPU interrupt mask register . If the priority level of the interrupt is higher than the value of the interrupt mask register, the CPU accepts the interrupt. However, software interrupts and illegal instruction interrupts generated by the CPU are processed without comparison with the value. The interrupt mask register value can be updated using the value of the EI instruction (Executing EI num sets the content of to num). For example, specifying EI3 enables the acceptance of maskable interrupts whose priority level set in the interrupt controller is 3 or higher, and enables the acceptance of non-maskable interrupts. However, if EI or EI0 is specified, maskable interrupts with a priority level of 1 or higher and non-maskable interrupts are accepted (Operationally identical to "EI" 1). Operationally, the DI instruction ( is 7) is identical to the EI 7 instruction, but as the priority level of maskable interrupts is 1 to 6, the DI instruction is used to dasable maskable interrupt. The EI instruction is vaild immediately after execution begins. (With TLCS-90, the EI instruction is vaild after execution of the instruction following the EI insutruction.) In addition to the general-purpose interrupt processing mode described above, TLCS-900/L1 interrupts have a micro DMA processing mode as well. Because the CPU transfers (Byte transfer, or 4-byte transfer) automatically in micro DMA mode, this mode can be used for speeding up interrupt processing, such as transferring data to I/O. TMP91C820A also has a micro DMA soft start function for requesting micro DMA processing by software not by interrupt. Figure 3.4.1 shows the overall interrupt processing flow.
91C820A-41
2006-01-31
TMP91C820A
Interrupt processing Micro DMA soft start request Yes
Interrupt specified by micro DMA start vector? No
Clear interrupt request flag
Interrupt vector value "V" read Interrupt request F/F clear
Data transfer by micro DMA
General-purpose interrupt processing
PUSH PC PUSH SR SR Level of accepted interrupt + 1 INTNEST INTNEST + 1
Count Count - 1
Micro DMA processing
Count = 0 No
Yes
Clear vector register generating micro DMA transfer and interrupt (INTTC0 to INTTC3)
PC (FFFF00H + V)
Interrupt processing program
RETI instruction POP SR POP PC INTNEST INTNEST - 1
End
Figure 3.4.1 Interrupt and Micro DMA Processing Sequence
91C820A-42
2006-01-31
TMP91C820A 3.4.1 General-purpose Interrupt Processing
When the CPU accepts an interrupt, it usually performs the following sequence of operations. However, in the case of software interrupts and illegal instruction interrupts generated by the CPU, the CPU skips steps a and c and executes only steps b, d and e. a. The CPU reads the interrupt vector from the interrupt controller. If there are simultaneous interrupts set to same level, the interrupt controller generates an interrupt vector in accordance with the default priority and clears the interrupt request. (The default priority is already fixed for each interrupt: The smaller the vector value, the higher the priority level.) The CPU pushes the program counter (PC) and status register (SR) onto the top of the stack (Pointed to by XSP). The CPU sets the value of the CPU's interrupt mask register to the priority level for the accepted interrupt plus 1. However, if the priority level for the accepted interrupt is 7, the register's value is set to 7. The CPU increments the interrupt nesting counter INTNEST by 1. The CPU jumps to the address indicated by the data at address FFFF00H + interrupt vector, and starts the interrupt processing routine.
b. c.
d. e.
The above processing time is 18 states (1.00 s at 36 MHz) as the best case (16-bit data bus width and 0 waits). When the CPU completed the interrupt processing, use the RETI instruction to return to the main routine. RETI restores the contents of the program counter and the status register from the stack and decrements the interrupt nesting counter INTNEST by 1. Non-maskable interrupts cannot be disabled by a user program. Maskable interrupts, however, can be enabled or disabled by a user program. A program can set the priority level for each interrupt source. (A priority level setting of 0 or 7 will disable an interrupt request.) If an interrupt request is received for an interrupt with a priority level equal to or greater than the value set in the CPU interrupt mask register , the CPU will accept the interrupt. The CPU interrupt mask register is then set to the value of the priority level for the accepted interrupt plus 1. If, during interrupt processing, an interrupt is generated with a higher level than the interrupt begin currently processed, or if, during non-maskable interrupt processing, a non-maskable interrupt request is generated from another source, the CPU suspends the currently processing routine and accepts the later interrupt. Then, after the CPU finished processing the later interrupt, the CPU returns to the interrupt it previously suspended and resumes processing. If the CPU receives a request for another interrupt while performing processing steps a to e, the second interrupt is sampled immediately after execution of the first instruction for its interrupt processing routine. Specifying DI as the start instruction disables maskable interrupt nesting. (Note: In the 900 and 900/L, sampling is performed before execution of the start instruction.) A reset initializes the interrupt mask register to 111, disabling all maskable interrupts. Table 3.4.1 shows the TMP91C820A interrupt vectors and micro DMA start vectors. FFFF00H to FFFFFFH (256 bytes) is designated as the interrupt vector area.
91C820A-43
2006-01-31
TMP91C820A
Table 3.4.1 TMP91C820A Interrupt Vectors and Micro DMA Start Vectors Default Priority
1 2 3 4 5 6 7 8 9 10 - 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 Maskable
Nonmaskable
Type
Interrupt Source and Source of Micro DMA Request
"Reset" or "SWI0" instruction "SWI1" instruction INTUNDEF: Illegal instruction or "SWI2" instruction "SWI3" instruction "SWI4" instruction "SWI5" instruction "SWI6" instruction "SWI7" instruction
NMI pin
Vector Vector Reference Value (V) Address
0000H 0004H 0008H 000CH 0010H 0014H 0018H 001CH 0020H 0024H - 0028H 002CH 0030H 0034H 0038H 003CH 0040H 0044H 0048H 004CH 0050H 0054H 0058H 005CH 0060H 0064H 0068H 006CH 0070H 0074H 0078H 007CH 0080H 0084H 0088H 008CH 0090H 0094H - - - 00A4H 00A8H 00ACH 00B0H 00B4H to 00FCH FFFF00H FFFF04H FFFF08H FFFF0CH FFFF10H FFFF14H FFFF18H FFFF1CH FFFF20H FFFF24H - FFFF28H FFFF2CH FFFF30H FFFF34H FFFF38H FFFF3CH FFFF40H FFFF44H FFFF48H FFFF4CH FFFF50H FFFF54H FFFF58H FFFF5CH FFFF60H FFFF64H FFFF68H FFFF6CH FFFF70H FFFF74H FFFF78H FFFF7CH FFFF80H FFFF84H FFFF88H FFFF8CH FFFF90H FFFF94H - - - FFFFA4H FFFFA8H FFFFACH FFFFB0H FFFFB4H to FFFFFCH
Micro DMA Start Vector
- - - - - - - - - - - 0AH 0BH 0CH 0DH 0EH 0FH 10H 11H 12H 13H 14H 15H 16H 17H 18H 19H 1AH 1BH 1CH 1DH 1EH 1FH 20H 21H - - - - - - - 29H 2AH 2BH 2CH - to -
INTWD: Watchdog timer (Micro DMA) INT0 pin INT1 pin INT2 pin INT3 pin INTALM0: ALM0 (8 kHz) INTALM1: ALM1 (512 Hz) INTALM2: ALM2 (64 Hz) INTALM3: ALM3 (2 Hz) INTALM4: ALM4 (1 Hz) INTTA0: 8-bit timer 0 INTTA1: 8-bit timer 1 INTTA2: 8-bit timer 2 INTTA3: 8-bit timer 3 INTRX0: Serial receives (Channel 0) INTTX0: Serial transmission (Channel 0) INTRX1: Serial receives (Channel 1) INTTX1: Serial transmission (Channel 1) INTAD: AD conversion end INTKEY: Key-on wakeup INTRTC: RTC (Alarm interrupt) INTSBI: SBI interrupt INTLCD: LCDC/LP pin INTP0: Protect 0 (WR to special SFR) INTP1: Protect 1 (WR to ROM) INTTC0: Micro DMA end (Channel 0) INTTC1: Micro DMA end (Channel 1) INTTC2: Micro DMA end (Channel 2) INTTC3: Micro DMA end (Channel 3) Reserved Reserved Reserved INTRX2: Serial receive (Channel 2) INTTX2: Serial transmission (Channel 2) INTTB00: 16-bit timer 0 (TB0RG0) INTTB01: 16-bit timer 1 (TB0RG1) (Reserved) to (Reserved)
91C820A-44
2006-01-31
TMP91C820A 3.4.2 Micro DMA Processing
In addition to general-purpose interrupt processing, the TMP91C820A supprots a micro DMA function. Interrupt requests set by micro DMA perform micro DMA processing at the highest priority level for maskable interrupts (Level 6), regardless of the priority level of the particular interrupt source. Because the micro DMA function has been implemented with the cooperative operation of CPU, when CPU is a state of standby by HALT instruction, the requirement of micro DMA will be ignored (Pending). (1) Micro DMA operation When an interrupt request is generated by an interrupt source specified by the micro DMA start vector register, the micro DMA triggers a micro DMA request to the CPU at interrupt priority level 6 and starts processing the request. The four micro DMA channels allow micro DMA processing to be set for up to four types of interrupts at any one time. When micro DMA is accepted, the interrupt request flip-flop assigned to that channel is cleared. The data are automatically transferred from the transfer source address to the transfer destination address set in the control register, and the transfer counter is decremented by 1. If the decremented counter reads other than 0, DMA processing ends with no change in the value of the micro DMA start vector register. If the decremented reading is 0, the micro DMA transfer end interrupt (INTTC0 to INTTC3) passes from the CPU to the interrupt controller. In addition, the micro DMA start vector register is cleared to 0, the next micro DMA is disabled and micro DMA processing completes. If a micro DMA request is set for more than one channel at a time, the priority is not based on the interrupt priority level but on the channel number: the smaller the channel number the higher the priority (Channel 0 (High) Channel 3 (Low)). If an interrupt request is triggered for the interrupt source in use during the interval between the clearing of the micro DMA start vector and the next setting, general-purpose interrupt processing executes at the interrupt level set. Therefore, if only using the interrupt for starting the micro DMA (Not using the interrupts as a general-purpose interrupt), first set the interrupts level to 0 (Interrupt requests disabled). If using micro DMA and general-purpose interrupts together as described above, first set the level of the interrupt used to start micro DMA processing lower than all the other interrupt levels. In this case, the cause of general interrupt is limited to the edge interrupt. (Note) As with other maskable interrupts, the priority of the micro DMA transfer end interrupts is determined by the interrupt level and by the default priority.
Note: If the priority level of micro DMA is set higher than that of other interrupts, CPU operates as follows. In case INTxxx interrupt is generated first and then INTyyy interrupt is generated between checking "Interrupt specified by micro DMA start vector" (in the Figure 3.4.1) and reading interrupt vector with setting below. The vector shifts to that of INTyyy at the time. This is because the priority level of INTyyy is higher than that of INTxxx. In the interrupt routine, CPU reads the vector of INTyyy because cheking of micro DMA has finished. And INTyyy is generated regardless of transfer counter of micro DMA. INTxxx: level 1 without micro DMA INTyyy: level 6 with micro DMA
91C820A-45
2006-01-31
TMP91C820A
While the register for setting the transfer source/transfer destination addresses is a 32-bit control register, this register can only effectively output 24-bit addresses. Accordingly, micro DMA can access 16 Mbytes (The upper 8 bits of the 32 bits are not valid). Three micro DMA transfer modes are supported: 1-byte transfer, 2-byte (One-word) transfer, and 4-byte transfer. After a transfer in any mode, the transfer source/destination addresses are incremented, decremented, or remain unchanged. This simplifies the transfer of data from I/O to memory, from memory to I/O, and from I/O to I/O. For details of the transfer modes, see 3.4.2 (4) "Detailed description of the transfer mode register". As the transfer counter is a 16-bit counter, micro DMA processing can be set for up to 65536 times per interrupt source. (The micro DMA processing count is maximized when the transfer counter initial value is set to 0000H.) Micro DMA processing can be started by the 31 interrupts shown in the micro DMA start vectors of Table 3.4.1 and by the micro DMA soft start, making a total of 32 interrupts. Figure 3.4.2 shows the word transfer micro DMA cycle in transfer destination address INC mode (except for counter mode, the same as for other modes). (The conditions for this cycle are based on an external 16-bit bus, 0 waits, transfer source/transfer destination addresses both even-numberd values).
One state
(Note 1) DM2 DM3 DM4 DM5 DM6
(Note 2) DM7 DM8
DM1 X1 A0 to A23
RD WR / HWR
Transfer source address
Transfer destination address
D0 to D15
Input
Output
Figure 3.4.2 Timing for Micro DMA Cycle States 1 to 3: Instruction fetch cycle (Gets next address code). If three or more instruction codes are inserted in the instruction queue buffer, this cycle becomes a dummy cycle. States 4 to 5: Micro DMA read cycle. State 6: Dummy cycle (The address bus remains unchanged from state 5). States 7 to 8: Micro DMA write cycle. Note 1: If the source address area is an 8-bit bus, it is incremented by two states. If the source address area is a 16-bit bus and the address starts from an odd number, it is incremented by two states. Note 2: If the destination address area is an 8-bit bus, it is incremented by two states. If the destination address area is a 16-bit bus and the address starts from an odd number, it is incremented by two states.
91C820A-46
2006-01-31
TMP91C820A
(2) Soft start function In addition to starting the micro DMA function by interrupts, TMP91C820A includes a micro DMA software start function that starts micro DMA on the generation of the write cycle to the DMAR register. Writing 1 to each bit of DMAR register causes micro DMA once (If write "0" to each bit, micro DMA doesn't operate). At the end of transfer, the corresponding bit of the DMAR register which support the end channel are automatically cleared to 0. Only one channel can be set for DMA request at once. (Do not write 1 to plural bits) When writing again 1 to the DMAR register, check whether the bit is 0 before writing 1. If read "1", micro DMA transfer isn't started yet. When a burst is specified by DMAB register, data is continuously transferred until the value in the micro DMA transfer counter is 0 after start up of the micro DMA. If execute soft start during micro DMA transfer by interrupt source, micro DMA transfer counter doesn't change. Don't use Read-modify-write instruction to avoid writing to other bits by mistake. Symbol Name
DMA request register
Address
89H (Prohibit RMW)
7
6
5
4
3
DMAR3 0
2
DMAR2 0
1
DMAR1 0
0
DMAR0 0
DMA request DMAR R/W
(3) Transfer control registers The transfer source address and the transfer destination address are set in the following registers. An instruction of the form "LDC cr, r" can be used to set these registers.
Channel 0 DMAS0 DMAD0 DMAC0 DMAM0 DMA source address register 0. DMA destination address register 0. DMA counter register 0. DMA mode register 0.
Channel 3 DMAS3 DMAD3 DMAC3 DMAM3 8 bits 16 bits 32 bits DMA source address register 3. DMA destination address register 3. DMA counter register 3. DMA mode register 3.
91C820A-47
2006-01-31
TMP91C820A
(4) Detailed description of the transfer mode register
8 bits DMAM0 to 0 DMAM3 0 0 Mode
Note: When setting a value in this register, write 0 to the upper three bits. Minimum Number of Execution States Execution Time (*) at fc = 36 MHz
8 states 444 ns
Number of Transfer Bytes
000 (Fixed) 000 00 Byte transfer
Mode Description
Transfer destination address INC mode .................................................I/O to memory (DMADn+) (DMASn) DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated.
01 10 001 00 01 10 010 00 01 10 011 00 01 10 100 00 01 10 101 00
Word transfer 4-byte transfer Byte transfer Word transfer 4-byte transfer Byte transfer Word transfer 4-byte transfer Byte transfer Word transfer 4-byte transfer Byte transfer Word transfer 4-byte transfer Counter mode
12 sates
667 ns
Transfer destination address DEC mode .................................................I/O to memory (DMADn-) (DMASn) DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated. Transfer source address INC mode .................................................Memory to I/O (DMADn) (DMASn+) DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated. Transfer source address DEC mode .................................................Memory to I/O (DMADn) (DMASn-) DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated. Fixed address mode ......................................................... I/O to I/O (DMADn) (DMASn-) DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated.
8 states
444 ns
12 sates
667 ns
8 states
444 ns
12 sates
667 ns
8 states
444 ns
12 sates
667 ns
8 states
444 ns
12 sates
667 ns
.....................For counting number of times interrupt is generated. DMASn DMASn + 1 DMACn DMACn - 1 If DMACn = 0, then INTTCn is generated. 5 sates 278 ns
(*) For external 16-bit bus, 0 waits, word/4-byte transfer mode, transfer source/transfer destination addresses both have even-numbered values. Note: n: Corresponding micro DMA channels 0 to 3. DMADn+/DMASn+: Post increment (Increments register value after transfer). DMADn-/DMASn-: Post decrement (Decrements register value after transfer). The I/Os in the table mean fixed address; memory means increment and decrement addresses. Do not use undefined code, that is, codes other than those listed above for the transfer mode register.
91C820A-48
2006-01-31
TMP91C820A 3.4.3 Interrupt Controller Operation
The block diagram in Figure 3.4.3 shows the interrupt circuits. The left-hand side of the diagram shows the interrupt controller circuit. The right-hand side shows the CPU interrupt request signal circuit and the halt release circuit. For each of the 36 interrupt channels there is an interrupt request flag (Consisting of a flip-flop), an interrupt priority setting register and a micro DMA start vector register. The interrupt request flag latches interrupt requests from the peripherals. The flag is cleared to zero in the following cases: when reset occurs, when the CPU reads the channel vector of an interrupt it has received, when the CPU receives a micro DMA request (When micro DMA is set), when the micro DMA burst transfer is terminated, and when an instruction that clears the interrupt for that channel is executed (by writing 0 to the clear bit in the interrupt priority setting register). An interrupt priority can be set independently for each interrupt source by writing the priority to the interrupt priority setting register (e.g., INTE0AD or INTE12). Six interrupt priorities levels (1 to 6) are provided. Setting an interrupt source's priority level to 0 (or 7) disables interrupt requests from that source. The priority of non-maskable interrupts (NMI pin interrupts and watchdog timer interrupts) is fixed at 7. If interrupt request with the same level are generated at the same time, the default priority (The interrupt with the lowest priority or, in other words, the interrupt with the lowest vector value) is used to determine which interrupt request is accepted first. The 3rd and 7th bits of the interrupt priority setting register indicate the state of the interrupt request flag and thus whether an interrupt request for a given channel has occurred. The interrupt controller sends the interrupt request with the highest priority among the simulateous interrupts and its vector address to the CPU. The CPU compares the priority value et in the status register by the interrupt request signal with the priority value set; if the latter is higher, the interrupt is accepted. Then the CPU sets a value higher than the priority value by 1 in the CPU SR. Interrupt request where the priority value equals or is higher than the set value are accepted simultaneously during the previous interrupt routine. When interrupt processing is completed (after execution of the RETI instruction), the CPU restores the priority value saved in the stack before the interrupt was generated to the CPU SR. The interrupt controller also has four registers used to store the micro DMA start vector. Writing the start vector of the interrupt source for the micro DMA processing (See Table 3.4.1), enables the corresponding interrupt to be processed by micro DMA processing. The values must be set in the micro DMA parameter register (e.g., DMAS and DMAD) prior to the micro DMA processing.
91C820A-49
2006-01-31
Interrupt controller Interrupt request F/F S R
V = 20H V = 24H
CPU 1 Interrupt mask F/F RESET
Interrupt request
NMI
Q
RESET interrupt vector read Priority setting register Priority encoder signal to CPU IFF2:0 3 3 1 7 3 INTRQ0
INTRQ2 to A
INTWD
Decoder
B C
Dn
EI1 to 7 DI Interrupt level detect
Dn + 1
Dn + 2
D Q CLR 6 6
Highest A priority B interrupt level select C
Y1 Y2 Y3 Y4 Y5 Y6 if INTRQ2 to 0 IFF2 to 0 then 1.
Interrupt request signal
INT0
Reset
Interrupt request F/F Dn + 3 SQ R Interrupt request F/F D0 D1 Interrupt vector read Micro DMA acknowledge 36
V = 28H V = 2CH V = 30H V = 34H V = 38H V = 3CH V = 40H V = 44H V = 48H V = 4CH Interrupt vector generator
1 2 3 4 5 6 7
INT1 INT2 INT3 INTALM0 INTALM1 INTALM2 INTALM3 INTALM4 INTTA0
D2 D3 D4 D5 D6 D7
During IDLE1 During STOP
Figure 3.4.3 Block Diagram of Interrupt Controller
91C820A-50
Interrupt vector read
V = A4H V = A8H V = ACH V = B0H
Halt release
RESET NMI 4 input OR 4 if IFF = 7 then 0 A B Micro DMA channel priority encoder 2 INT0 to INT3, INTKEY, INTRTC, INTALM
Reserved INTRX2 INTTX2 INTTB00 INTTB01
Micro DMA start vector setting register
Soft start 34 S
Selector
Micro DMA request
D5 D4 D3 D2 D1 D0
DQ CLR 6
INTTC0 DMA0V DMA1V DMA2V DMA3V
RESET
0 1 2 3
2
Micro DMA channel specification
TMP91C820A
2006-01-31
TMP91C820A
(1) Interrupt level setting registers
Symbol
Name
INT0 and INTAD enable
Address
7
IADC R 0
6
INTAD IADM2 0 INT2 I2M2 0 INTALM4 IA4M2 0 INTALM1 IA1M2 0 INTALM3 IA3M2 0 ITA1M2 0 ITA3M2 0 INTKEY IKM2 0 INTTX0 ITX0M2 0
5
IADM1 R/W 0 I2M1 R/W 0 IA4M1 R/W 0 IA1M1 R/W 0 IA3M1 R/W 0 ITA1M1 R/W 0 ITA3M1 R/W 0 IKM1 R/W 0 ITX0M1 R/W 0
4
IADM0 0 I2M0 0 IA4M0 0 IA1M0 0 IA3M0 0 ITA1M0 0 ITA3M0 0 IKM0 0 ITX0M0 0
3
I0C R 0 I1C R 0 I3C R 0 IA0C R 0 IA2C R 0 ITA0C R 0 ITA2C R 0 IRC R 0 IRX0C R 0
2
INT0 I0M2 0 INT1 I1M2 0 INT3 I3M2 0 INTALM0 IA0M2 0 INTALM2 IA2M2 0 ITA0M2 0 ITA2M2 0 INTRTC IRM2 0 INTRX0 IRX0M2 0
1
I0M1 R/W 0 I1M1 R/W 0 I3M1 R/W 0 IA0M1 R/W 0 IA2M1 R/W 0 ITA0M1 R/W 0 ITA2M1 R/W 0 IRM1 R/W 0 IRX0M1 R/W 0
0
I0M0 0 I1M0 0 I3M0 0 IA0M0 0 IA2M0 0 ITA0M0 0 ITA2M0 0 IRM0 0 IRX0M0 0
INTE0AD
90H
INTE12
INT1 and INT2 enable
91H
I2C R 0
INTE3ALM4
INT3 and INTALM4 enable INTALM0 and INTALM1 enable INTALM2 and INTALM3 enable INTTA0 and INTTA1 enable INTTA2 and INTTA3 enable
92H
IA4C R 0 IA1C R 0 IA3C R 0 ITA1C R 0 ITA3C R 0 IKC R 0 ITX0C R 0
INTEALM01
93H
INTEALM23
94H
INTTA1 (TMRA1) 95H
INTTA0 (TMRA0)
INTETA01
INTTA3 (TMRA3) 96H
INTTA2 (TMRA2)
INTETA23
INTRTC and INTERTCKEY INTKEY enable Interrupt enable serial 0
97H
INTES0
98H
Interrupt request flag
lxxM2
0 0 0 0 1 1 1 1
lxxM1
0 0 1 1 0 0 1 1
lxxM0
0 1 0 1 0 1 0 1
Function (Write)
Disables interrupt requests Sets interrupt priority level to 1 Sets interrupt priority level to 2 Sets interrupt priority level to 3 Sets interrupt priority level to 4 Sets interrupt priority level to 5 Sets interrupt priority level to 6 Disables interrupt requests
91C820A-51
2006-01-31
TMP91C820A
Symbol
Name
INTRX1 and INTTX1 enable
Address
7
ITXT1C R 0 ILCD1C R 0 ITC1C R 0 ITC3C R 0 IP1C R 0 ITX2C R 0 ITB1C R 0
6
INTTX1 ITX1M2 0 INTLCD ILCDM2 0 INTTC1 ITC1M2 0 INTTC3 ITC3M2 0 INTP1 IP1M2 0 INTTX2 ITX2M2 0 INTTB01 ITB1M2 0
5
ITX1M1 R/W 0 ILCDM1 R/W 0 ITC1M1 R/W 0 ITC3M1 R/W 0 IP1M1 R/W 0 ITX2M1 R/W 0 ITB1M1 R/W 0
4
ITX1M0 0 ILCDM0 0 ITC1M0 0 ITC3M0 0 IP1M0 0 ITX2M0 0 ITB1M0 0
3
IRX1C R 0 ISBIC R 0 ITC0C R 0 ITC2C R 0 IP0C R 0 IRX2C R 0 ITB0C R 0
2
INTRX1 IRX1M2 0 INTSBI ISBIM2 0 INTTC0 ITC0M2 0 INTTC2 ITC2M2 0 INTP0 IP0M2 0 INTRX2 IRX2M2 0 INTTB00 ITB0M2 0
1
IRX1M1 R/W 0 ISBIM1 R/W 0 ITC0M1 R/W 0 ITC2M1 R/W 0 IP0M1 R/W 0 IRX2M1 R/W 0 ITB0M1 R/W 0
0
IRX1M0 0 ISBIM0 0 ITC0M0 0 ITC2M0 0 IP0M0 0 IRX2M0 0 ITB0M0 0
INTES1
99H
INTSBI and INTES2LCD INTLCD enable INTTC0 and INTTC1 enable INTTC2 and INTTC3 enable INTP0 and INTP1 enable INTRX2 and INTTX2 enable INTTB00 and INTTB01 enable
9AH
INTETC01
9BH
INTETC23
9CH
INTEP01
9DH
INTES3
A0H
INTETB0
A1H
Interrupt request flag
lxxM2
0 0 0 0 1 1 1 1
lxxM1
0 0 1 1 0 0 1 1
lxxM0
0 1 0 1 0 1 0 1
Function (Write)
Disables interrupt requests Sets interrupt priority level to 1 Sets interrupt priority level to 2 Sets interrupt priority level to 3 Sets interrupt priority level to 4 Sets interrupt priority level to 5 Sets interrupt priority level to 6 Disables interrupt requests
91C820A-52
2006-01-31
TMP91C820A
(2) External interrupt control Symbol Name Address 7
- 8CH IIMC Interrupt input mode control 0 Always write "0". (Prohibit RMW)
6
- 0 Always write "0".
5
I3EDGE 0
4
I2EDGE
W
3
I1EDGE 0
2
I0EDGE 0
1
I0LE 0
0
NMIREE 0 1: Operates even on rising/ falling edge of
NMI
0
INT3EDGE INT2EDGE INT1EDGE INT0EDGE 0: INT0 edge 0: Rising 0: Rising 0: Rising 0: Rising mode 1: Falling 1: Falling 1: Falling 1: Falling 1: INT0 level mode
INT0 level enable 0 1 0 1 edge detect INT H level INT INT request generation at falling edge INT request generation at rising/falling edge
NMI rising edge enable
(3) Interrupt request flag clear register The interrupt request flag is cleared by writing the appropriate micro DMA start vector, as given in Table 3.4.1 to the register INTCLR. For example, to clear the interrupt flag INT0, perform the following register operation after execution of the DI instruction. INTCLR 0AH: Clears interrupt request flag INT0. Symbol Name Address
Interrupt clear control 88H 0 (Prohibit RMW) 0 0
7
6
5
CLRV5
4
CLRV4
3
CLRV3 W
2
CLRV2 0
1
CLRV1 0
0
CLRV0 0
INTCLR
Interrupt vector
(4) Micro DMA start vector registers This register assigns micro DMA processing to an interrupt source. The interrupt source with a micro DMA start vector that matches the vector set in this register is assigned as the micro DMA start source. When the micro DMA transfer counter value reaches zero, the micro DMA transfer end interrupt corresponding to the channel is sent to the interrupt controller, the micro DMA start vector register is cleared, and the micro DMA start source for the channel is cleared. Therefore, to continue micro DMA processing, set the micro DMA start vector register again during the processing of the micro DMA transfer end interrupt. If the same vector is set in the micro DMA start vector registers of more than one channel; the channel with the lowest number has a higher priority. Accordingly, if the same vector is set in the micro DMA start vector registers of two channels, the interrupt generated in the channel with the lower number is executed until micro DMA transfer is complete. If the micro DMA start vector for this channel is not set again, the next micro DMA is started for the channel with the higher number. (Micro DMA chaining.)
91C820A-53
2006-01-31
TMP91C820A
Symbol
Name
DMA0 start vector
Address
7
6
5
DMA0V5 0
4
DMA0V4 0 DMA1V4 0 DMA2V4 0 DMA3V4 0
3
DMA0V3 0 DMA1V3 0 DMA2V3 0 DMA3V3 0
2
DMA0V2 0 DMA1V2 0 DMA2V2 0 DMA3V2 0
1
DMA0V1 0 DMA1V1 0 DMA2V1 0 DMA3V1 0
0
DMA0V0 0 DMA1V0 0 DMA2V0 0 DMA3V0 0
DMA0 start vector DMA0V 80H R/W DMA1 start vector DMA1V DMA1 start vector 81H DMA1V5 0 DMA2 start vector DMA2V5 0 DMA3 start vector DMA3V5 0 R/W DMA2 start vector DMA2V 82H R/W DMA3 start vector DMA3V 83H R/W
(5) Micro DMA burst specification Specifying the micro DMA burst continues the micro DMA transfer until the transfer counter register reaches zero after micro DMA start. Setting a bit which corresponds to the micro DMA channel of the DMAB registers mentioned below to 1 specifies a burst. Symbol Name
DMA software request register
Address
89H (Prohibit RMW)
7
6
5
4
3
DMAR3 R/W 0 DMAB3
2
DMAR2 R/W 0 DMAB2 R/W 0
1
DMAR1 R/W 0 DMAB1 0
0
DMAR0 R/W 0 DMAB0 0
DMAR
1: DMA software request
DMAB
DMA burst register
8AH
0
1: DMA burst request
91C820A-54
2006-01-31
TMP91C820A
(6) Notes The instruction execution unit and the bus interface unit of this CPU operate independently. Therefore, immediately before an interrupt is generated, if the CPU fetches an instruction that clears the corresponding interrupt request flag, the CPU may execute the instruction that clears the interrupt request flag between accepting and reading the interrupt vector. In this case, the CPU reads the default vector 0008H and reads the interrupt vector address FFFF08H. To avoid the above problem, place instructions that clear interrupt request flags after a DI instruction. And in the case of setting an interrupt enable again by EI instruction after the execution of clearing instruction, execute EI instruction after clearing and more than 1 instructions (ex. "NOP" x 1 time). If placed EI instruction without waiting NOP instruction after execution of clearing instruction, interrupt will be enable before request flag is cleared. In the case of changing the value of the interrupt mask register by execution of POP SR instruction, disable an interrupt by DI instruction before execution of POP SR instruction. In addition, take care as the following 2 circuits are exceptional and demand special attention.
;INT0 level mode In level mode INT0 is not an edge-triggered interrupt. Hence, in level mode the interrupt request flip-flop for INT0 does not function. The peripheral interrupt request passes through the S input of the flip-flop and becomes the Q output. If the interrupt input mode is changed from edge mode to level mode, the interrupt request flag is cleared automatically. If the CPU enters the interrupt response sequence as a result of INT0 going from 0 to 1, INT0 must then be held at 1 until the interrupt response sequence has been completed. If INT0 is set to level mode so as to release a halt state, INT0 must be held at 1 from the time INT0 changes from 0 to 1 until the halt state is released. (Hence, it is necessary to ensure that input noise is not interpreted as a 0, causing INT0 to revert to 0 before the halt state has been released.) When the mode changes from level mode to edge mode, interrupt request flags which were set in level mode will not be cleared. Interrupt request flags must be cleared using the following sequence. DI LD (IIMC), 00H ; Switches interrupt input mode from level mode to edge mode. ; Wait EI instruction
LD (INTCLR), 0AH ; Clears interrupt request flag. NOP EI INTRX The interrupt request flip-flop can only be cleared by a reset or by reading the serial channel receive buffer. It cannot be cleared by writing INTCLR register.
Note:
The following instructions or pin input state changes are equivalent to instructions that clear the interrupt request flag.
INT0: Instructions which switch to level mode after an interrupt request has been generated in edge mode. The pin input changes from high to low after an interrupt request has been generated in level mode. (H L) INTRX: Instructions which read the receive buffer.
91C820A-55
2006-01-31
TMP91C820A
3.5
Port Functions
The TMP91C820A features 126-bit settings which relate to the various I/O ports. As well as general-purpose I/O port functionality, the port pins also have I/O functions which relate to the built-in CPU and internal I/Os. Table 3.5.1 and Table 3.5.2 list the functions of each port pin. Table 3.5.3, Table 3.5.4 and Table 3.5.5 list I/O registers and their specifications. Table 3.5.1 Port Functions (1/2)
(R: PU = with programmable pull-up resistor) (U = with pull-up resistor)
Port Name
Port 0 Port 1 Port 2 Port 3 Port 4 Port Z
Pin Name
P00 to P07 P10 to P17 P20 to P27 P30 to P37 P40 to P47 PZ0 PZ1 PZ2 PZ3
Number of Pins
8 8 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1
Direction
I/O I/O I/O I/O I/O Output Output I/O I/O I/O Output Output Output Output Output Output Output Output I/O I/O I/O I/O I/O I/O I/O I/O Input Input Output I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O
R
- - - - - - - PU PU PU - - - - - - - - - - - - - - - - - U - - - - - - - - - - - - -
Direction Setting Unit
Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit Bit Bit Bit Bit Bit Bit Bit (Fixed) (Fixed) (Fixed) Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
Pin Name for Built-in Function
D0 to D7 D8 to D15 A16 to A23 A8 to A15 A0 to A7
RD WR HWR
R / W , SRWE
WAIT CS0 CS1 , SDCS CS2 , CS2A CS3
Port 5 Port 6
P56 P60 P61 P62 P63 P64 P65 P66 P67
EA24, CS2B EA25, CS2C
CS2C , SRLB CS2E , SRUB
Port 7
P70 P71 P72 P73 P74 P75 P76 P77
SCK, OPTRX0 SO, SDA , OPTTX0 SI/SCL
CS2F CS2G CSEXA
MSK VEECLK AN0 to AN7, ADTRG (P83) KI0 to KI7 KO0 to KO7 TA0IN, TXD2 TA1OUT, RXD2 INT0 INT1 INT2, TA3OUT INT3, TB0OUT0 TXD0 RXD0 SCLK0, CTS0 TXD1 RXD1 SCLK1, CTS1
Port 8 Port 9 Port A Port B
P80 to P87 P90 to P97 PA0 to PA7 PB0 PB1 PB3 PB4 PB5 PB6
Port C
PC0 PC1 PC2 PC3 PC4 PC5
91C820A-56
2006-01-31
TMP91C820A
Table 3.5.2 Port Functions (2/2)
(R: PU = with programmable pull-up resistor) (U = with pull-up resistor)
Port Name
Port D
Pin Name
PD0 PD1 PD2 PD3 PD4 PD6 PD7
Number of Pins
1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1
Direction
Output Output Output Output Output Output Output I/O Output Output Output Output Output Output Output Output
R
- - - - - - - - - - - - - - - -
Direction Setting Unit
(Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) Bit (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed) (Fixed)
Pin Name for Built-in Function
D1BSCP D2BLP D3BFR DLEBCD DOFFB
ALARM , MLDALM
MLDALM LD0 to LD7
SDRAS SDCAS SDWE
Port E Port F
PD0 to PD7 PF0 PF1 PF2 PF3 PF4 PF5 PF6 PF7
SDLDQM SDUDQM SDCKE SDCLK
91C820A-57
2006-01-31
TMP91C820A
Table 3.5.3 I/O Registers and Specifications (1/3) Port
Port 0
Pin Name
P00 to P07 Input port Output port
Specification
I/O Register Pn
X X X X X X X X X X X X X X X X X X X 0 1 X X X X 0 1 X 0 1 X X X X X X X X X X X X X X X None 0 0 1 1 0 1 0 0 1 0 0 0 1 1 X 1 X 1 1 X 1 X 1 X 1 X 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1 None None
PnCR
0 1 X 0 1 0 0 1 1 0 1 1 0 1 1
PnFC PnFC2
None 0 0 1 X 0 1 X 0 1 X 0 1 0 1 0 1 0 0 0 1 1 1 None None None None None None
D0 to D7 bus Port 1 P10 to P17 Input port Output port D8 to D15 bus Port 2 P20 to P27 Input port Output port A16 to A23 output Port 3 P30 to P47 Input port Output port A8 to A15 output Port 4 P30 to P47 Input port Output port A0 to A7 output Port Z PZ0 PZ1 PZ2, PZ3 Output port
RD output
Output port
WR output
Input port (without PU) Input port (with PU) Output port
PZ2 PZ3 Port 5 P56
HWR output
R/W output
SRWE output
Input port (without PU) Input port (with PU) Output port
WAIT input (without PU) WAIT input (with PU)
Port 6
P60 to P67 P60 P61 P62 P63 P64 P65 P66 P67
Output port
CS0 output CS1 output SDCS output CS2 output CS2A output CS3 output
EA24 output
CS2B output
EA25 output
CS2C output SRLB output CS2D output SRUB output CS2E output
X: Don't care
91C820A-58
2006-01-31
TMP91C820A
Table 3.5.4 I/O Registers and Specifications (2/3) Port
Port 7
Pin Name
P70 to P77 P70 Input port Output port SCK input SCK output
Specification
I/O Register Pn
X X X X
PnCR
0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 0 1
PnFC PnFC2
0 0 0 1 X 0 1 1 X 0 0 1 X X X 0 1 1 1 1 0 0 None 0 0 0 0 1 0 0 0 1
OPTRX0 input P71 SDA input SDA output SO output OPTTX0 output P72 SI input SCL input SCL output P73 P74 P75 P76 P77 Port 8 P80 to P87 P83 Port 9 Port A P90 to P97 PA0 to PA7
CS2F output CS2G output CSEXA output
(Note 1) (Note 2) (Note 1)
1 X X X 1 X X
(Note 2)
X X X X
MSK input VEECLK output Input port AN0 to AN7 input
ADTRG input
(Note 3)
X X X
(Note 4) (Note 5)
X X X X X X X X X X 0 1 0 1 1 0 0 0 0 1 0 1
None 0 1 0 None 0 1 0 0 0 1 1 0 1 1 1 1 1 1 None
Input port KI0 to KI7 input Output port KO0 to KO7 output (CMOS) KO0 to KO7 output (Open drain)
None
None
Port B
PB0 to PB6 PB0 PB1 PB3 PB4 PB5 PB6
Input port Output port TA0IN input TXD2 output TA1OUT output RXD2 input INT0 input INT1 input INT2 input TA3OUT INT3 input TB0OUT0 (Note 1) (Note 1)
X X X X X 0 1 0 1
X: Don't care
91C820A-59
2006-01-31
TMP91C820A
Table 3.5.5 I/O Registers and Specifications (3/3) Port
Port C
Pin Name
PC0 to PC5 PC0 PC1 PC2 Input port Output port
Specification
I/O Register Pn
X X
PnCR
0 1 1 0 0 1 0 1 0 0 1 0
PnFC PnFC2
0 0 1 None 0 1 0 1 None 0 1 0 0 1 1 1
TXD0 output RXD0 input SCLK0 input SCLK0 output
CTS0 input
(Note 1) (Note 1, 6) (Note 1) (Note 1) (Note 1) (Note 1) (Note 1) (Note 1) (Note 1) (Note 1)
1 1 1 1 1 1 1 1 1 1 X X X X X X 1 0 X X X X X X X X X X X X
PC3 PC4 PC5
TXD1 output RXD1 input SCLK1 input SCLK1 output
CTS1 input
Port D
PD0 to PD7 PD0 PD1 PD2 PD3 PD4 PD6 PD7
Output port D1BSCP output D2BLP output D3BFR output DLEBCD output DOFFB output
ALARM output MLDALM output
None
None
1 1 1 1 1
MLDALM output Input port Output port LD0 to LD7 output
Port E
PE0 to PE7
0 1 1
0 0 1 0 1 1 1 1 1 1 1
Port F
PF0 to PF7 PF0 PF1 PF2 PF3 PF4 PF5 PF6
Output port
SDRAS output SDCAS output SDWE output
None
SDLDQM output SDUDQM output SDCKE output SDCLK output
X: Don't care
Note 1: As for input ports of SIO1 to SIO3: (OPTTX0, OPTRX0, TXD0, RXD0, SCLK0, CTS0 , TXD1, RXD1, SCLK1, CTS1 , TXD2, RXD2), logical selection for output data or input data is determined by the output latch register Pn of each port. Note 2: When P71/P72 are used as SDA/SCL open-drain outputs, P70DE is used to set the open-drain output mode. Note 3: In case using P76 for MSK port, set to P7FC. Note 4: When P80 to P87 are used as AD converter input channels, ADMOD1 is used to select the channel. Note 5: When P83 is used as ADTRGE input, ADMOD1 is used to enable external-trigger input. Note 6: In case using PC1 for RXD0 port, set "0" to P7FC2.
91C820A-60
2006-01-31
TMP91C820A 3.5.1 Port 0 (P00 to P07)
Port 0 is an 8-bit general-purpose I/O port. Each bit can be set individually for input or output using the control register P0CR. Resetting resets all bits of the output latch P0, the control register P0CR to 0 and sets port 0 to input mode. In addition to functioning as a general-purpose I/O port, port 0 can also function as an data bus (D0 to D7). When external memory is accesed, the port automatically functions as the data bus (D0 to D7) and all bits of P0CR are cleared to 0.
Reset
Direction control (on bit basis) P0CR write A S P00 to P07 (D0 to D7) External access External access (Data write) Internal data bus Output latch P0 write D0 to D7
Selector Output buffer B
P0 read
External access (Data read)
Figure 3.5.1 Port 0
Port 0 Register
7
P0 (0000H) Bit symbol Read/Write After reset P07
6
P06
5
P05
4
P04 R/W
3
P03
2
P02
1
P01
0
P00
Data from external port (Output latch register is cleared to 0.) Port 0 Control Register
7
P0CR (0002H) Bit symbol Read/Write After reset Function 0 P07C
6
P06C 0
5
P05C 0
4
P04C W 0
3
P03C 0
2
P02C 0
1
P01C 0
0
P00C 0
Port 0 input/output settings 0: Input 1:Output
Note 1: Read-modify-write is prohibited for P0CR. Note 2: When functioning as a data bus (D0 to D7), P0CR is cleared to 0.
Figure 3.5.2 Register for Port 0
91C820A-61
2006-01-31
TMP91C820A 3.5.2 Port 1 (P10 to P17)
Port 1 is an 8-bit general-purpose I/O port. Each bit can be set individually for input or output using the control register P1CR and the function register P1FC. Resetting resets all bits of the output latch P1, the control register P1CR and the function register P1FC to 0 and sets port 1 to input mode. In addition to functioning as a general-purpose I/O port, port 1 can also function as an data bus (D8 to D15). AM1 AM0
0 0 1 1 0 1 0 1
P1xF
0 1 - 0
Function Setting after Reset is Released
Input port Data bus (D8 to D15) Don't use this setting Input port
Reset Direction control (on bit basis) P1CR write Function control (on bit basis) Internal data bus P1FC write Output latch P1 write D8 to D15 A S Port 1 P10 to P17 (D8 to D15)
External access (Data write)
Selector Output buffer B
P1 read
External access (Data read)
Figure 3.5.3 Port 1
91C820A-62
2006-01-31
TMP91C820A
Port 1 Register
7
P1 P0 (0001H) (0000H) Bit symbol Read/Write After reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Data from external port (Output latch register is cleared to 0.)
Port 1 Control Register
7
P1CR (0004H) Bit symbol Read/Write After reset Function 0 P17C
6
P16C 0
5
P15C 0
4
P14C W 0
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
Port 1 function settings
Port 1 Function Register
7
P1FC (0005H) Bit symbol Read/Write After reset (Note3) Function 0/1 P17F
6
P16F 0/1
5
P15F 0/1
4
P14F W 0/1
3
P13F 0/1
2
P12F 0/1
1
P11F 0/1
0
P10F 0/1
Port 1 function settings
Port 1 function settings Note 1: Read-modify-write is prohibited for P1CR and P1FC. Note 2: is bit x in register P1FC; , in register P1CR. Note 3: It is set to "Port" or "Data bus " by AM pins state. P1FC 0 P1CR 0 1 Input port Output port Data bus (D15 to D8) Don't set 1
Figure 3.5.4 Register for Port 1
91C820A-63
2006-01-31
TMP91C820A 3.5.3 Port 2 (P20 to P27)
Port 2 is an 8-bit general-purpose I/O port. Each bit can be set individually for input or output using the control register P2CR and the function register P2FC. In addition to functioning as a general-purpose I/O port, port 2 can also function as an address bus (A16 to A23). Setting the AM1 and AM0 pins as shown below and resetting the device initialize port 2 to the following function pins. AM1 AM0 P2xC
0 0 1 1 0 1 0 1 1 1 - 0
P2xF Function Setting after Reset is Released
1 1 - 0 Address bus (A16 to A23) Address bus (A16 to A23) Don't use this setting Input port
Reset
Internal address bus A16 to A23
Direction control (on bit basis) P2CR write Function control (on bits basis) Internal data bus S Selector P2FC write B P20 to P27 (A16 to A23)
Output latch P2 write
A
Output buffer
P2 read
Figure 3.5.5 Port 2
91C820A-64
2006-01-31
TMP91C820A
Port 2 Register
7
P2 P0 (0006H) (0000H) Bit symbol Read/Write After reset P27
6
P26
5
P25
4
P24 R/W
3
P23
2
P22
1
P21
0
P20
Data from external port (Output latch register is cleared to 0.)
Port 2 Control Register
7
P2CR (0008H) Bit symbol Read/Write After reset (Note3) Function 0/1 P27C
6
P26C 0/1
5
P25C 0/1
4
P24C W 0/1
3
P23C 0/1
2
P22C 0/1
1
P21C 0/1
0
P20C 0/1
Port 2 function settings
Port 2 Function Register P2FC (0009H)
7
Bit symbol Read/Write After reset (Note3) Function 0/1 P27F
6
P26F 0/1
5
P25F 0/1
4
P24F W 0/1
3
P23F 0/1
2
P22F 0/1
1
P21F 0/1
0
P20F 0/1
Port 2 function settings
Note 1: Read-modify-write is prohibited for P2CR and P2FC. Note 2: is bit x in register P2FC; , in register P2CR. Note 3: It is set to "Port" or "Address bus " by AM pins state.
Port 2 function settings P2FC 0 P2CR 0 1 Input port Output port Address bus (A16 to A23) 1
Figure 3.5.6 Register for Port 2
91C820A-65
2006-01-31
TMP91C820A 3.5.4 Port 3 (P30 to P37)
Port 3 is an 8-bit general-purpose I/O port. Each bit can be set individually for input or output using the control register P3CR and the function register P3FC. In addition to functioning as a general-purpose I/O port, port 3 can also function as an address bus (A8 to A15). Setting the AM1 and AM0 pins as shown below and resetting the device initialize port 3 to the following function pins. AM1 AM0 P3xC
0 0 1 1 0 0 0 1 1 1 - 0
P3xF Function Setting after Reset is Released
1 1 - 0 Address bus (A8 to A15) Address bus (A8 to A15) Don't use this setting Input port
Reset
Internal address bus A8 to A15
Direction control (on bit basis) P3CR write Function control (on bit basis) Internal data bus S Selector P3FC write B P30 to P37 (A8 to A15)
Output latch P3 write
A
Output buffer
P3 read
Figure 3.5.7 Port 3
91C820A-66
2006-01-31
TMP91C820A
Port 3 Register
7
P3 P0 (0007H) (0000H) Bit symbol Read/Write After reset P37
6
P36
5
P35
4
P34 R/W
3
P33
2
P32
1
P31
0
P30
Data from external port (Output latch register is cleared to 0.)
Port 3 Control Register
7
P3CR (000AH) Bit symbol Read/Write After reset (Note3) Function 0/1 P37C
6
P36C 0/1
5
P35C 0/1
4
P34C W 0/1
3
P33C 0/1
2
P32C 0/1
1
P31C 0/1
0
P30C 0/1
Port 3 function settings
Port 3 Function Register P3FC (000BH)
7
Bit symbol Read/Write After reset (Note3) Function 0/1 P37F
6
P36F 0/1
5
P35F 0/1
4
P34F W 0/1
3
P33F 0/1
2
P32F 0/1
1
P31F 0/1
0
P30F 0/1
Port 3 function settings
Note 1: Read-modify-write is prohibited for P3CR and P3FC. Note 2: is bit x in register P3FC; , in register P3CR. Note 3: It is set to "Port" or "Address bus" by AM pins state.
Port 3 function settings P3FC 0 P3CR 0 1 Input port Output port Address bus (A8 to A15) 1
Figure 3.5.8 Register for Port 3
91C820A-67
2006-01-31
TMP91C820A 3.5.5 Port 4 (P40 to P47)
Port 4 is an 8-bit general-purpose I/O port. Each bit can be set individually for input or output using the control register P4CR and the function register P4FC. In addition to functioning as a general-purpose I/O port, port 4 can also function as an address bus (A0 to A7). Setting the AM1 and AM0 pins as shown below and resetting the device initialize port 4 to the following function pins. AM1 AM0 P4xC
0 0 1 1 0 1 0 1 1 1 - 0
P4xF Function Setting after Reset is Released
1 1 - 0 Address bus (A0 to A7) Address bus (A0 to A7) Don't use this setting Input port
Reset
Internal address bus A0 to A7
Direction control (on bit basis) P4CR write Function control (on bit basis) Internal data bus S Selector P4FC write B P40 to P47 (A0 to A7)
Output latch P4 write
A
Output buffer
P4 read
Figure 3.5.9 Port 4
91C820A-68
2006-01-31
TMP91C820A
Port 4 Register
7
P4 P0 (000CH) (0000H) Bit symbol Read/Write After reset P47
6
P46
5
P45
4
P44 R/W
3
P43
2
P42
1
P41
0
P40
Data from external port (Output latch register is cleared to 0.)
Port 4 Control Register
7
P4CR (000EH) Bit symbol Read/Write After reset (Note3) Function 0/1 P47C
6
P46C 0/1
5
P45C 0/1
4
P44C W 0/1
3
P43C 0/1
2
P42C 0/1
1
P41C 0/1
0
P40C 0/1
Port 4 function settings
Port 4 Function Register P4FC (000FH)
7
Bit symbol Read/Write After reset (Note3) Function 0/1 P47F
6
P46F 0/1
5
P45F 0/1
4
P44F W 0/1
3
P43F 0/1
2
P42F 0/1
1
P41F 0/1
0
P40F 0/1
Port 4 function settings
Note 1: Read-modify-write is prohibited for P4CR and P4FC. Note 2: is bit x in register P4FC; , in register P4CR. Note 3: It is set to "Port" or "Address bus" by AM pins state.
Port 4 function settings P4FC 0 P4CR 0 1 Input port Output port Address bus (A0 to A7) 1
Figure 3.5.10 Register for Port 4
91C820A-69
2006-01-31
TMP91C820A 3.5.6 Port Z (PZ0 to PZ3)
Port Z is an 4-bit general-purpose I/O port (P50 and P51 are used for output only). I/O is set using control register PZCR and PZFC. Resetting resets all bits of the output latch PZ to 1. In addition to functioning as a general-purpose I/O port, port Z also functions as I/O for the CPU's control/status signal. When PZ0 pin is defined as RD strobe signal output mode ( = 1), clearing the output latch register to 0 outputs the RD strobe (Used for the peused static RAM) from the PZ0 pin even when the internal addressed. If the output latch register remains 1, the RD strobe signal is output only when the external address are is accessed. Resetting initializes PZ2 and PZ3 pins to input mode with pull-up resistor. Setting the AM1 and AM0 pins as shown below and resetting the device initialize PZ0 and PZ1 pins to the following function pins. PZ0F Function Setting after Reset is Released PZ1F
1 1 - 0 PZ0 function
RD pin RD pin
AM1 AM0
0 0 1 1 0 1 0 1
PZ1 function
WR pin WR pin Don't use this setting Output port
Don't use this setting Output port
Reset
Function control (on bit basis) PZFC write
Internal data bus
S latch B PZ write
Selector
Output
A PZ0 ( RD ) Output buffer
PZ read
RD
Internal address area
Figure 3.5.11 Port Z (PZ0)
91C820A-70
2006-01-31
TMP91C820A
Reset
Function control (on bit basis) PZFC write Internal data bus S latch B PZ write Selector Output A PZ1 ( WR ) Output buffer
PZ read
WR
Internal address area
Reset
Direction control (on bit basis) PZCR write Function conrtol
Internal data bus
(on bit basis) PZFC write S
Selector
P-ch A B
(Programmable pull up)
S Output latch PZ write
PZ2 ( HWR ) Output buffer
HWR
PZ read
Figure 3.5.12 Port Z (PZ1, PZ2)
91C820A-71
2006-01-31
TMP91C820A
Reset
Direction control (on bit basis) PZCR write Function conrtol (on bit basis) Internal data bus PZFC write S Selector S Output latch PZ write A PZ3 ( R / W , SRWE ) Output buffer B C P-ch (Programmable pull up)
R/W
SRWE
P5 read
Figure 3.5.13 Port Z (PZ3)
91C820A-72
2006-01-31
TMP91C820A
Port Z Register
7
PZ (007DH) Bit symbol Read/Write After reset Function
6
5
4
3
PZ3
2
PZ2 R/W
1
PZ1 1 -
0
PZ0 1 -
Data form external port (Note 1)
0(Output latch register): Pull-up resistor OFF 1(Output latch register): Pull-up resistor ON
Port Z Control Register
7
PZCR (007EH) Bit symbol Read/Write After reset Function
6
5
4
3
PZ3C W 0 0: Input
2
PZ2C 0 1: Output
1
0
Port Z Function Register
7
PZFC (007FH) Bit symbol Read/Write After reset Function
6
5
4
3
PZ3F 0 0: Port 1: R / W ,
SRWE
2
PZ2F W 0 0: Port 1: HWR
1
PZ1F 0 0: Port 1: WR
0
PZ0F 0 0: Port 1: RD
Note 1: Output latch register is set to 1. R / W , SRWE setting Note 2: Read-modify-write is prohibited for registers PZCR and PZFC. 0 Note 3: When port Z is used in input mode, the PZ register controls the Input 0 built-in pull-up resistor. R/W 1 Read-modify-write is prohibited in input mode or I/O mode. Setting the built-in pull-up resistor may be depended on the states of the input pin.
PZ0 ( RD ) function setting

1 Output
SRWE
0 1
0 Output Prohibit this setting
1 Output
RD
PZ1 ( WR ) function setting
0 1
0 Output
WR
1 Output
HWR setting
PZFC
1
PZCR 1
Figure 3.5.14 Register for Port Z
91C820A-73
2006-01-31
TMP91C820A 3.5.7 Port 5 (P56)
Port 5 is an 1-bit general-purpose I/O port. I/O is set using control register P5CR and P5FC. Resetting resets all bits of the output latch P5 to P1. In addition to functioning as a general-purpose I/O port, port 5 also functions as I/O for the CPU's control/status signal. Resetting initializes P56 pins to input mode with pull-up resistor.
Reset
Direction control (on bit basis) P5CR write
Internal data bus
P-ch
(Programmable pull up) P56 ( WAIT )
S Output latch P5 write
Output buffer
Internal WAIT
P5 read
Figure 3.5.15 Port 5 (P56)
91C820A-74
2006-01-31
TMP91C820A
Port 5 Register
7
P5 (000DH) Bit symbol Read/Write After reset
6
P56 R/W Data from external port (Output latch register is set to 1.)
5
4
3
2
1
0
Function
0(Output latch register): Pull-up resistor OFF 1(Output latch register): Pull-up resistor ON
Port 5 Control Register
7
P5CR (0010H) Bit symbol Read/Write After reset Function Note:
6
P56C W 0 0: Input 1: Output
5
4
3
2
1
0
When the P53/WAIT pin is to be use as the WAIT pin, P5CR must be set to 0 and in the chip select/wait control register must be set 010.
Figure 3.5.16 Register for Port 5
91C820A-75
2006-01-31
TMP91C820A 3.5.8 Port 6 (P60 to P67)
Port 60 to 67 are 8-bit output ports. Resetting sets output latch of P62 to 0 and output latches of P60 to P61 and P63 to P67 are set to 1. Port 6 also function as chip-select output ( CS0 to CS3 ), extend address output (EA24, EA25), extend chip-select output ( CS2A , CS2B , CS2C , CS2D , CS2E ), SRAM byte control output ( SRUB , SRLB ), and SDRAM chip-select output ( SDCS ). Writing 1 in the corresponding bit of P6FC, P6FC2 enables the respective functions. Resetting reset the P6FC and P6FC2 to 0, and sets all bits to output ports.
Reset
Function control 2 (on bit basis) P6FC2 write Function control (on bit basis) P6FC write S Output lacth P6 write A B C Selector P60 ( CS0 ) P61 ( CS1 , SDCS ) P62 ( CS2 , CS2A ) P63 ( CS3 ) P64 (EA24, CS2B ) P65 (EA25, CS2C ) P66 ( SRLB , CS2D ) P67 ( SRUB , CS2E )
Internal data bus
SDCS , CS2A , CS2B , CS2C , CS2D , CS2E
P6 read
CS0 , CS1 , CS2 , CS3 , EA24, EA25, SRLB , SRUB
Figure 3.5.17 Port 6
Port 6 Register
7
P6 (0012H) Bit symbol Read/Write After reset 1 P67
6
P66 1
5
P65 1
4
P64 R/W 1
3
P63 1
2
P62 0
1
P61 1
0
P60 1
Port 6 Function Register
7
P6FC (0015H) Bit symbol Read/Write After reset Function 0: Port 1: SRUB P67F
6
P66F
5
P65F
4
P64F W 0
3
P63F
2
P62F
1
P61F
0
P60F
0: Port 1: SRLB
0: Port 1: EA25
0: Port 1: EA24
0: Port 1: CS3
0: Port 1: CS2
0: Port 1: CS1
0: Port 1: CS0
Port 6 Function Register 2
7
P6FC2 (001BH) Bit symbol Read/Write After reset Function P67F2
6
P66F2
5
P65F2
4
P64F2 W 0
3
-
2
P62F2
1
P61F2
0
-
0: 0: 0: 0: 1: CS2E 1: CS2D 1: CS2C 1: CS2B
Always write "0".
0: 0: 1: CS2A 1: SDCS
Always write "0".
Note: Read-modify-write is prohibited for P6FC and P6FC2.
Figure 3.5.18 Register for Port 6
91C820A-76
2006-01-31
TMP91C820A 3.5.9 Port 7 (P70 to P77)
Port 7 is an 8-bit general-purpose I/O port. I/O can be set on bit basis using the control register. Resetting sets port 7 to input port and all bits of output latch to 1. In addition to functioning as a general-purpose I/O port, port 7 also functions as follows. 1. Input/output function for serial bus interface (SCK, SO/SDA, SI/SCL) 2. 3. 4. Input/output function for IrDA (OPTRX0, OPTTX0) Extend chip-select output ( CS2F , CS2G , CSEXA ) Clock control function for voltage booster of external LCD driver (MSK, VEECLK)
Writing 1 in the corresponding bit of P7FC, P7FC2 enables the respective functions. Resetting resets the P7FC, P7FC2 to 0, and sets all bits to input ports. (1) Port 70 (SCK, OPTRX0) Port 70 is a general-purpose I/O port. It is also used as SCK (Clock signal for SIO mode) and OPTRX0 (Receive input for IrDA mode of SIO0). Used as OPTRX0, it is possible to logical invert by P7. For port C1, RXD0 or OPTRX0 is used P7FC2.
Reset Direction control (on bit basis) P7CR write Function control (on bit basis) Internal data bus P7FC write S Output latch P7 write SCK output SB Selector P7 read Function control 2 (on bit basis) P7FC2 write RXD0 (to SIO0) A SCK input Logical invert SB Selector A RXD0PC1 (from PORTC1) A S P70 (SCK, OPTRX0)
Selector B
Figure 3.5.19 Port 70
91C820A-77
2006-01-31
TMP91C820A
(2) Port 71 (SO/SDA/OPTTX0) Port 71 is a general-purpose I/O port. It is also used as SDA (Data input for I2C bus mode), SO (Data output for SIO mode) for serial bus interface and OPTTX0 (Transmit output for IrDA mode of SIO0). Used as OPTTX0, it is possible to logical invert by P7.
Reset Function control 2 (on bit basis) P7FC2 write Direction control (on bit basis) Internal data bus P7CR write Function control (on bit basis) P7FC write S Output latch P7 write SO output
A
S P71(SO/SDA, OPTTX0)
Open-drain possible: P7ODE
Selector B C
TXD0 output
Logical invert
SB Selector
P7 read SDA input
A
Figure 3.5.20 Port 71
91C820A-78
2006-01-31
TMP91C820A
(3) Port 72 (SI/SCL) Port 72 is a general-purpose I/O port. It is also used as SI (Data input for SIO mode), SCL (Clock input/output for I2C bus mode) for serial bus interface.
Reset Direction control (on bit basis) P7CR write Function control (on bit basis) P7FC write S Output latch P7 write SCL output
Internal data bus
A
S P72 (SI/SCL)
Open-drain possible: P7ODE
Selector B
SB Selector P7 read SI input SCL input A
Figure 3.5.21 Port 72
91C820A-79
2006-01-31
TMP91C820A
(4) Port 73 ( CS2F ), 74 ( CS2G ), 75 ( CSEXA ) Port 73 to 75 are general-purpose I/O ports. These are also used as control signal for sequential mask ROM and extend chip-select output.
Reset Function control 2 (on bit basis) P7FC2 write Direction control (on bit basis) Internal data bus P7CR write Funtcion control (on bit basis) P7FC write S Output latch P7 write
CS2F , CS2G , CSEXA
A
S P73 ( CS2F ), P74 ( CS2G ), P75 ( CSEXA )
Selector B
SB Selector P7 read A
Figure 3.5.22 Port 73, 74, 75
91C820A-80
2006-01-31
TMP91C820A
(5) Port 76 (MSK), 77 (VEECLK) Port 76 and 77 are general-purpose I/O ports. These are also used as clock control function for voltage booster of external LCD driver. MSK pin (P76) is an input pin from external LCD driver, clock output from VEECLK pin is controlled by state of this pin. Logic of this pin is controlled with P7FC. VEECLK pin outputs clock of 32 kHz for voltage booster or 0 level according to request from MSK pin. VEECLK output is controlled with P7FC.
Reset
Direction control (on bit basis) P7CR write
Internal data bus
S Output latch P7 write S P7 read
P76 (MSK)
B
Selector A
Function control (on bit basis) P7FC write fs clock VEECLK
Reset
Direction control (on bit basis) P7CR write Function control (on bit basis) P7FC write
Internal data bus
S Output latch A P7 write
S P77 (VEECLK)
Selector B S B
P7 read
Selector A
Figure 3.5.23 Port 76, 77
91C820A-81
2006-01-31
TMP91C820A
Port 7 Register
7
P7 (0013H) Bit symbol Read/Write After reset P77
6
P76
5
P75
4
P74 R/W
3
P73
2
P72
1
P71
0
P70
Data from external port (Output latch register is set to 1.) Port 7 Control Register
7
P7CR (0016H) Bit symbol Read/Write After reset Function 0 P77C
6
P76C 0
5
P75C 0 0: Input
4
P74C W 0
3
P73C 0 1: Output
2
P72C 0
1
P71C 0
0
P70C 0
Port 7 Function Register
7
P7FC (0017H) Bit symbol Read/Write After reset Function 0:Port P77F
6
P76F
5
P75F
4
P74F W 0
3
P73F
2
P72F
1
P71F
0
P70F
MSK
0: Enable 1: Enable
0: Port
0: Port
0: Port
0: Port 1: SCL/SI
0: Port 1: SDA/SO
0: Port 1: SCK
1:VEECLK select
Port 7 Function Register 2
7
P7FC2 (001CH) Bit symbol Read/Write After reset Function
Always write "0".
6
-
5
P75F2
4
P74F2 W 0
3
P73F2
2
-
1
P71F2
0
P70F2
-
Always write "0".
0: 1: CSEXA
0: 1: CS2G
0: 1: CS2F
Always write 0: "0". 1: OPTTX0
SIO0/RXD0 Pin select
0: RXD0(PC1) 1: OPTRX0 (P70)
Port 7 ODE Register
7
P7ODE (001FH) Bit symbol Read/Write After reset Function 0
Always write "0".
6
- W 0
5
4
3
2
ODEP72 W 0 0: 3 states 1: Open drain
1
ODEP71 0
0
-
Note:
Read-modify-write is prohibited for P7CR, P7FC, P7FC2 and P7ODE.
Figure 3.5.24 Register for Port 7
91C820A-82
2006-01-31
TMP91C820A 3.5.10 Port 8 (P80 to P87)
Port 8 is an 8-bit input port and can also be used as the analog input pins for the internal AD converter. P83 can also be used as ADTRG pin for the AD converter.
Port 8 Internal data bus Port 8 read P80 to P87 (AN0 to AN7)
Conversion result register
AD converter
Channel selector
AD read
ADTRG (for P83 only)
Figure 3.5.25 Port 8
Port 8 Register
7
P8 (0018H) Bit symbol Read/Write After reset P87
6
P86
5
P85
4
P84 R
3
P83
2
P82
1
P81
0
P80
Data from external port
Note: The input channel selection of AD converter and the permission of ADTRG input are set by AD converter mode register ADMOD1.
Figure 3.5.26 Register for Port 8
91C820A-83
2006-01-31
TMP91C820A 3.5.11 Port 9 (P90 to P97)
Port 90 to 97 are 8-bit input ports with pull-up resistor. In addition to functioning as general-purpose I/O port, port 90 to 97 can also key-on wakeup function as keyboard interface. The various functions can each be enabled by writing a 1 to the corresponding bit of the port 9 function register (P9FC). Resetting resets all bits of the register P9FC to 0 and sets all pins to be input port.
INTKEY Internal data bus
Rising edge detection
P90 to P97 8-OR
Reset Key-on enable (on bit basis) P9FC write P90 to P97 (KI0 to KI7) P9 read Pull-up resistor
Figure 3.5.27 Port 9 When P9FC = 1, if either of input of KI0 to KI7 pins falls down, INTKEY interrupt is generated. INTKEY interrupt can be used to release all HALT mode.
Port 9 Register
7
P9 (0019H) Bit symbol Read/Write After reset P97
6
P96
5
P95
4
P94 R
3
P93
2
P92
1
P91
0
P90
Data from external port Port 9 Function Register
7
P9FC (001DH) Bit symbol Read/Write After reset Function 0 P97F
6
P96F 0
5
P95F 0
4
P94F W 0
3
P93F 0
2
P92F 0
1
P91F 0
0
P90F 0
0: Key-in disable
1: Key-in enable
Key-in of port 9 Disable Enable Note: Read-modify-write is prohibited for the registers P9FC. 0 1
Figure 3.5.28 Register for Port 9
91C820A-84
2006-01-31
TMP91C820A 3.5.12 Port A (PA0 to PA7)
Port PA0 to PA7 are 8-bit output ports, and also used key board interface pin KO0 to KO7 which can set open-drain output buffer. Writing 1 in the corresponding bit of the port A function register (PAFC) enable the open-drain output. Resetting reset bits of the registers PA to 1 and PAFC to 0, and all pin outputs 1.
Reset Output buffer set Internal data bus PAFC write S Output latch PA write PA read Programmable open drain PA0 to PA7 (KO0 to KO7)
Figure 3.5.29 Port A
Port A Register
7
PA (001EH) Bit symbol Read/Write After reset 1 PA7
6
PA6 1
5
PA5 1
4
PA4 R/W 1
3
PA3 1
2
PA2 1
1
PA1 1
0
PA0 1
Port A Function Register
7
PAFC (0021H) Bit symbol Read/Write After reset Function Note: 0 PA7F
6
PA6F 0
5
PA5F 0
4
PA4F W 0 0: CMOS output
3
PA3F 0 1: Open drain
2
PA2F 0
1
PA1F 0
0
PA0F 0
Read-modify-write is prohibited for PAFC.
Figure 3.5.30 Register for Port A
91C820A-85
2006-01-31
TMP91C820A 3.5.13 Port B (PB0 to PB6)
Port B is a 6-bit general-purpose I/O port. Each bit can be set individually for input or output. Resetting sets port B to be an input port. In addition to functioning as a general-purpose I/O port, port B can also function as I/O pin for timers (TA0IN, TA1OUT, TA3OUT, TB0OUT0), input pin for external interruption (INT0 to INT3), and I/O for serial channels 2 (TXD2, RXD2). Above setting is used the function register PBFC and PBFC2. Edge select of external interruption establishes it with IIMC register, which there is in interruption controller. (1) PB0 (TA0IN, TXD2) As well as functioning as I/O port pins, port B0 can also function as serial channel TXD output pins. In case of use TXD2, it is possible to logical invert by setting the register PB. And port B0 has a programmable open-drain function which can be control the register PBODE.
Reset
Direction control (on bits basis)
PBCR write Function control (on bit basis) PBFC write S Output latch PB write TXD2 A S
Open-drain possible: PBODE
Internal data bus
PB0 (TA0IN, TXD2)
Selector B S B
Selector PB read TA0IN A
Figure 3.5.31 Port B0
91C820A-86
2006-01-31
TMP91C820A
(2) PB1 (TA1OUT, RXD2) Port B1 is I/O port pins and can also is used as RXD input for the serial channels. In case of use RXD2, it is possible to logical invert by setting the register PB.
Reset
Direction control (on bits basis)
PBCR write Function control (on bit basis) PBFC write S Output latch PB write TA1OUT A S
Internal data bus
PB1 (TA1OUT, RXD2)
Selector B S B
Selector PB read RXD2 A
Figure 3.5.32 Port B1 (3) PB3 (INT0)
Reset
Direction control (on bits basis)
PBCR write Internal data bus
Function control (on bits basis)
PBFC write S Output latch PB write SB Selector PB read A Level/edge select and rising/falling select IIMC PB3 (INT0)
INT0
Figure 3.5.33 Port B3
91C820A-87
2006-01-31
TMP91C820A
(4) PB4 (INT1), PB5 (INT2, TA3OUT), PB6 (INT3, TB0OUT0)
Reset
Direction control (on bits basis)
PBCR write Function control (on bit basis) PBFC write Internal data bus S Output latch PB write S B
PB4 (INT1)
Selector PB read A
INT1
Rising/falling edge detection IIMC
Reset
Direction control (on bits basis)
PBCR write Function control (on bit basis) PBFC write Internal data bus S Output latch PB write TA3OUT TB0OUT0 PB read A S
Selector B S B
PB5 (INT2, TA3OUT) PB6 (INT3, TB0OUT0)
Selector A
INT2 to INT3
Rising/falling edge detection IIMC< I2EDGE, I3EDGE >
Figure 3.5.34 PB4 to PB6
91C820A-88
2006-01-31
TMP91C820A
Port B Register
7
PB (0022H) Bit symbol Read/Write After reset Function
6
PB6
5
PB5 R/W
4
PB4
3
PB3
2
1
PB1 R/W
0
PB0
Data from external port (Output latch register is set to 1.)
Data from external port (Output latch register is set to 1.)
-
-
-
-
(Note 3)
-
Port B Control Register
7
PBCR (0024H) Bit symbol Read/Write After reset Function
6
PB6C 0
5
PB5C W 0 0: Input
4
PB4C 0 1: Output
3
PB3C 0
2
1
PB1C W 0
0
PB0C 0
0: Input 1: Output
Port B Function Register
7
PBFC (0025H) Bit symbol Read/Write After reset Function
6
PB6F 0 0: Port 1: INT3
TB0OUT0
5
PB5F W 0 0: Port 1: INT2
TA3OUT
4
PB4F 0 0: Port 1: INT1
3
PB3F 0 0: Port 1: INT0
2
1
PB1F W 0 0: Port 1: TA1OUT
0
PB0F 0 0:Port 1:TXD2
INT2, TA3OUT setting
0 1 0 1
0 Input port INT2
1 Output port TA3OUT
INT3, TB0OUT0 setting 0 Input port INT3 1 Output port TB0OUT0
Port B ODE Register
7
PBODE (002BH) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
ODEPB0 W 0 TXD2 0: CMOS 1: Open drain
Note 1: Read-modify-write is prohibited for the registers PBCR, PBFC and PBODE. Note 2: PB0/TA0IN pin does not have a register changing PORT/FUNCTION. For example, when it is used as an input port, the input signal is inputted to 8-bit timer. Note 3: PB1/RXD1 pin does not have a register changing PORT/FUNCTION. For example, when it is used as an input port, the input signal is inputted to SIO as the serial receive data.
Figure 3.5.35 Register for Port B
91C820A-89
2006-01-31
TMP91C820A 3.5.14 Port C (PC0 to PC5)
Port C0 to C5 are 6-bit general-purpose I/O ports. Each bit can be set individually for input or output. Resetting sets PC0 to PC5 to be an input ports. It also sets all bits of the output latch register to 1. In addition to functioning as general-purpose I/O port pins, PC0 to PC5 can also function as the I/O for serial channels 0 and 1. A pin can be enabled for I/O by writing a 1 to the corresponding bit of the port C function register (PCFC). Resetting resets all bits of the registers PCCR and PCFC to 0 and sets all pins to be input ports. (1) Port C0, C3 (TXD0/TXD1) As well as functioning as I/O port pins, port C0 and C3 can also function as serial channel TXD output pins. In case of use TXD0/TXD1, it is possible to logical invert by setting the register PC. And ports C0 to C3 have a programmable open-drain function, which can be control the register PCODE.
Reset Direction control (on bit basis) PCCR write Internal data bus Function control (on bit basis) PCFC write S Output latch PC write
TXD0, TXD1 Logical invert
A
S PC0 (TXD0) PC3 (TXD1)
Selector B S B
PC read
Selector A
Open-drain possible: PCODE
Figure 3.5.36 Port C0 and Port C3
91C820A-90
2006-01-31
TMP91C820A
(2) Port C1, C4 (RXD0, 1) Port C1 and C4 are I/O port pins and can also be used as RXD input for the serial channels. In case of use RXD0/RXD1, it is possible to logical invert by setting the register PC. And input data of SIO0 can be select from RXD/PC1 pin or OPTRX0/P70 by setting the register PCFC2.
Reset Ditection control (on bit basis) Internal data bus PCCR write S Output latch PC write
PC read RXD0, RXD1 Logical invert
PC1 (RXD0) PC4 (RXD1) S B Selector A
Figure 3.5.37 Port C1 and Port C4 (3) Port C2 ( CTS0 , SCLK0), C5 ( CTS1 , SCLK1) Port C2 and C4 are I/O port pins and can also be used as CTS input or SCLK input/output for the serial channels. In case of use CTS , SCLK, it is possible to logical invert by setting the register PC.
Reset Ditection control (on bit basis) PCCR write Internal data bus Function control (on bit basis) PCFC write S Output latch PC write
Logical invert
A
S
PC2 (SCLK0, CTS0 ) PC5 (SCLK1, CTS1 )
Selector B
SCLK0, SCLK1 output
SB Selector
PC read
CTS0 CTS1
A
, ,
SCLK0, SCLK1 input
Logical invert
Figure 3.5.38 Port C2 and Port C5
91C820A-91
2006-01-31
TMP91C820A
Port C Register
7
PC (0023H) Bit symbol Read/Write After reset
6
5
PC5
4
PC4
3
PC3 R/W
2
PC2
1
PC1
0
PC0
Data from external port (Output latch register is set to 1.) Port C Control Register
7
PCCR (0026H) Bit symbol Read/Write After reset Function
6
5
PC5C 0
4
PC4C 0
3
PC3C W 0 0: Input
2
PC2C 0 1: Output
1
PC1C 0
0
PC0C 0
Port C Functon Register
7
PCFC (0027H) Bit symbol Read/Write After reset Function
6
5
PC5F W 0 0: Port 1: SCLK1
output
4
3
PC3F W 0 0: Port 1: TXD1
2
PC2F W 0 0: Port 1: SCLK0
output
1
0
PC0F W 0 0: Port 1: TXD0
Port C ODE Register
7
PCODE (0028H) Bit symbol Read/Write After reset Function
6
5
4
3
ODEPC3 W 0 TXD1 0: CMOS 1: Open
drain
2
1
0
ODEPC0 W 0 TXD0 0: CMOS 1: Open
drain
Note 1: Read-modify-write is prohibited for the registers PCCR, PCFC and PCODE. Note 2: PC1/RXD0, PC4/RXD1 pins do not have a register changing PORT/FUNCTION. For example, when it is used as an input port, the input signal is inputted to SIO as the serial receive data.
Figure 3.5.39 Register for Port C
91C820A-92
2006-01-31
TMP91C820A 3.5.15 Port D (PD0 to PD7)
Port D is an 8-bit output port. Resetting sets the output latch PD to 1, and PD0 to PD7 pin output 1. In addition to functioning as output port, port D also function as output pin for LCD controller (DIBSCP, D2BLP, D3BFR, DLEBCD and DOFFB), output pin for RTC alarm ( ALARM ) and output pin for melody/alarm generator (MLDALM, MLDALM ). Above setting is used the function register PDFC. Only PD6 has two output function which are ALARM and MLDALM . This selection is used PD. Resetting resets the function register PDFC to 0, and sets all ports to output ports.
Reset
Function control Internal data bus (on bit basis) PDFC write S Output latch Selector A B PD write D1BSCP, D2BLP, D3BFR, DLEBCD, DOFFB, MLDALM PD read PD0 (D1BSCP), PD1 (D2BLP), PD2 (D3BFR), PD3 (DLEBCD), PD4 (DOFFB), PD7 (MLDALM)
Output buffer
Figure 3.5.40 Port D0 to D4, D7
Reset Function control (on bit basis) PDFC write Internal data bus S Output latch S A Y Selector B PD6 ( ALARM , MLDALM )
PD write PD read
MLDALM ALARM
A
S
Y Selector B
Figure 3.5.41 Port D6
91C820A-93
2006-01-31
TMP91C820A
Port D Register
7
PD (0029H) Bit symbol Read/Write After reset 1 PD7 R/W
6
PD6 1
5
4
PD4 1
3
PD3 1
2
PD2 R/W 1
1
PD1 1
0
PD0 1
Port D Function Register
7
PDFC (002AH) Bit symbol Read/Write After reset Function
0: Port 1: MLDALM
6
PD6F W 0
0: Port 1: ALARM at = 1 1: MLDALM at = 0
5
4
PD4F
3
PD3F
2
PD2F W 0
1
PD1F
0
PD0F
PD7F
0: Port 1: DOFFB
0: Port 1: DLEBCD
0: Port 1: D3BFR
0: Port 1: D2BLP
0: Port 1: D1BSCP
Note:
Read-modify-write is prohibited for the registers PDFC.
Figure 3.5.42 Register for Port D
91C820A-94
2006-01-31
TMP91C820A 3.5.16 Port E (PE0 to PE7)
Port E is an 8-bit general-purpose I/O ports. Each bit can be set individually for input or output using the control register PECR. Resetting, the control register PECR to 0 and sets Port E to input ports. It also sets all bits of the output latch register to 1. In addition to functioning as a general-purpose I/O port, port E can also function as an data bus for LCD controller (LD0 to LD7). Above setting is used the function register PEFC.
Reset Direction control (on bit basis) PECR write Function control (on bit basis) PEFC write S Output latch PE write LD7 to LD0
Internal data bus
A
S PE0 to PE7 (LD0 to LD7)
Selector B
SB Selector PE read A
Figure 3.5.43 Port E
Port E Register
7
PE (002CH) Bit symbol Read/Write After reset PE7
6
PE6
5
PE5
4
PE4 R/W
3
PE3
2
PE2
1
PE1
0
PE0
Data from external port (Output latch register is set to 1.) Port E Control Register
7
PECR (002DH) Bit symbol Read/Write After reset Function 0 PE7C
6
PE6C 0
5
PE5C 0
4
PE4C W 0 0: Input
3
PE3C 0 1: Output
2
PE2C 0
1
PE1C 0
0
PE0C 0
Port E Function Register
7
PEFC (002EH) Bit symbol Read/Write After reset Function 0 PE7F
6
PE6F 0
5
PE5F 0 0: Port
4
PE4F W 0
3
PE3F 0
2
PE2F 0
1
PE1F 0
0
PE0F 0
1: Data bus for LCDC (LD7 to LD0)
Note: Read-modify-write is prohibited for PECR and PEFC.
Figure 3.5.44 Register for Port E
91C820A-95
2006-01-31
TMP91C820A 3.5.17 Port F (PF0 to PF7)
Port F is an 8-bit output port. Resetting sets the output latch PF to 1, and PF0 to PF7 pin output 1. In addition to functioning as output port, port F also function as output pin for SDRAM controller (SDCKE, SDCLK, SDLDQM, SDUDQM, SDWE ), and output pin for SSIO (SSCLK). Above setting is used the function register PFFC.
Reset
Function control (on bit basis)
Internal data bus
PFFC write S Output latch
Selector
A B
Output buffer
PF write
SDRAS , SDCAS , SDWE , SDLDQM, SDUDQM, SDCKE, SDCLK
PF0 ( SDRAS ) PF1 ( SDCAS ) PF2 ( SDWE ) PF3 (SDLDQM) PF4 (SDUDQM) PF5 (SDCKE) PF6 (SDCLK) PF7
PF read
Figure 3.5.45 Port F
Port F Register
7
PF (0030H) Bit symbol Read/Write After reset 1 PF7
6
PF6 1
5
PF5 1
4
PF4 R/W 1
3
PF3 1
2
PF2 1
1
PF1 1
0
PF0 1
Port F Function Register
7
PFFC (0032H) Bit symbol Read/Write After reset Function
"0".
6
PF6F 1
1: SDCLK
5
PF5F 0
0: Port 1: SDCKE
4
PF4F W 0
0: Port
3
PF3F 0
0: Port
2
PF2F 0
1
PF1F 0
0: Port 1: SDCAS
0
PF0F 0
0: Port 1: SDRAS
- 0
Always write 0: Port
0: Port 1: SDUDQM 1: SDLDQM 1: SDWE
Note: Read-modify-write is prohibited for the registers PFFC.
Figure 3.5.46 Register for Port F
91C820A-96
2006-01-31
TMP91C820A
3.6
Chip Select/Wait Controller
On the TMP91C820A, four user-specifiable address areas ( CS0 to CS3 ) can be set. The data bus width and the number of waits can be set independently for each address area ( CS0 to CS3 and others). The pins CS0 to CS3 (which can also function as port pins P60 to P63) are the respective output pins for the areas CS0 to CS3. When the CPU specifies an address in one of these areas, the corresponding CS0 to CS3 pin outputs the chip select signal for the specified address area (in ROM or SRAM). However, in order for the chip select signal to be output, the port 6 function register (P6FC) must be set. CS2A to CS2G and CSEXA (CS pin except CS0 to CS3 ) are made by MMU. These pins are CS pin that area and BANK value is fixed without concern in setting of CS/WAIT controller. The areas CS0 to CS3 are defined by the values in the memory start address registers MSAR0 to MSAR3 and the memory address mask registers MAMR0 to MAMR3. The chip select/wait control registers B0CS to B3CS and BEXCS should be used to specify the master enable/disable status the data bus width and the number of waits for each address area. The input pin controlling these states is the bus wait request pin ( WAIT ).
3.6.1
Specifying an Address Area
The CS0 to CS3 address areas are specified using the start address registers (MSAR0 to MSAR3) and memory address mask registers (MAMR0 to MAMR3). At each bus cycle, a compare operation is performed to determine if the address on the specified a location in the CS0 to CS3 area. If the result of the comparison is a match, this indicates an access to the corresponding CS area. In this case, the CS0 to CS3 pin outputs the chip select signal and the bus cycle operates in accordance with the settings in chip select/wait control register B0CS to B3CS. (See 3.6.2 "Chip Select/Wait Control Registers".)
91C820A-97
2006-01-31
TMP91C820A
(1) Memory start address registers Figure 3.6.1 shows the memory start address registers. The memory start address registers MSAR0 to MSAR3 set the start addresses for the CS0 to CS3 areas. Set the upper eight bits (A23 to A16) of the start address in . The lower 16 bits of the start address (A15 to A0) are permanently set to 0. Accordingly, the start address can only be set in 64-Kbyte increments, starting from 000000H. Figure 3.6.2 shows the relationship between the start address and the start address register value.
Memory Start Address Registers (for areas CS0 to CS3)
7
MSAR0 (00C8H) MSAR2 (00CCH) MSAR1 Bit symbol (00CAH) Read/Write MSAR3 After reset (00CEH) Function S23 1
6
S22 1
5
S21 1
4
S20 R/W 1
3
S19 1
2
S18 1
1
S17 1
0
S16 1
Determines A23 to A16 of start address. Sets start addresses for areas CS0 to CS3.
Figure 3.6.1 Memory Start Address Register
Start address Address 000000H 64 Kbytes
Value in start address register (MSAR0 to MSAR3).
000000H .................... 00H 010000H .................... 01H 020000H .................... 02H 030000H .................... 03H 040000H .................... 04H 050000H .................... 05H 060000H .................... 06H to to FF0000H .................... FFH
FFFFFFH
Figure 3.6.2 Relationship between Start Address and Start Address Register Value
91C820A-98
2006-01-31
TMP91C820A
(2) Memory address mask registers Figure 3.6.3 shows the memory address mask registers. Memory address mask registers MAMR0 to MAMR3 are used to set the size of the CS0 to CS3 areas by specifying a mask for each bit of the start address set in memory start address registers MAMR0 to MAMR3. The compare operation used to determine if an address is in the CS0 to CS3 areas is only performed for bus address bits corresponding to bits set to 0 in these registers. Also, the address bits that can be masked by MAMR0 to MAMR3 differ between CS0 to CS3 areas. Accordingly, the size that can be each area is different.
Memory Address Mask Register (for CS0 area)
7
MAMR0 (00C9H) Bit symbol Read/Write After reset Function 1 V20
6
V19 1
5
V18 1
4
V17 R/W 1
3
V16 1
2
V15 1
1
V14 to V9 1
0
V8 1
Sets size of CS0 area
0: Used for address compare
Range of possible settings for CS0 area size: 256 bytes to 2 Mbytes
Memory Address Mask Register (CS1)
7
MAMR1 Bit symbol (00CBH) Read/Write After reset Function V21 1
6
V20 1
5
V19 1
4
V18 R/W 1
3
V17 1
2
V16 1
1
V15 to V9 1
0
V8 1
Sets size of CS1 area
0: Used for address compare
Range of possible settings for CS1 area size: 256 bytes to 4 Mbytes.
Memory Address Mask Register (CS2, CS3)
7
MAMR2 (00CDH) MAMR3 Bit symbol (00CFH) Read/Write After reset Function V22 1
6
V21 1
5
V20 1
4
V19 R/W 1
3
V18 1
2
V17 1
1
V16 1
0
V15 1
Sets size of CS2 or CS3 area
0: Used for address compare
Range of possible settings for CS2 and CS3 area sizes: 32 Kbytes to 8 Mbytes.
Figure 3.6.3 Memory Address Mask Registers
91C820A-99
2006-01-31
TMP91C820A
(3) Setting memory start addresses and address areas Figure 3.6.4 shows an example of specifying a 64-Kbyte address area starting from 010000H using the CS0 areas. Set 01H in memory start address register MSAR0 (Corresponding to the upper 8 bits of the start address). Next, calculate the difference between the start address and the anticipated end address (01FFFFH) based on the size of the CS0 area. Bits 20 to 8 of the result correspond to the mask value to be set for the CS0 area. Setting this value in memory address mask register MAMR0 sets the area size. This example sets 07H in MAMR0 to specify a 64K-byte area.
0
0 0
0
0
0
0 1
0
1
1
1 F
1
1
1
1 F
1
1
1
1 F
1
1
1
1 F
1
1 H
Memory end address CS0 area size (64 Kbytes) Memory start address
S23 S22 S21 S20 S19 S18 S17 S16
MSAR0
0
0 0
0
0
0
0 1
0
1 H
V20 V19 V18 V17 V16 V15
V14 to V9
V8
MSMR0 0
0
0
0
0 0
0
0
0
1
1
1
1 7
1
1
1
1
1 H
1
1
1
1
1
1
1
Memory address mask register setting
Setting of 07H specifies a 64-Kbyte area.
Figure 3.6.4 Example Showing How to Set the CS0 Area After a reset, MSAR0 to MSAR3 and MAMR0 to MAMR3 are set to FFH. B0CS, B1CS and B3CS are reset to 0. This disabling the CS0, CS1 and CS3 areas. However, as B2CS to 0 and B2CS to 1, CS2 is enabled from 000FE0H to 000FFFH and 003000H to FFFFFFH in TMP91C820A. Also, the bus width and number of waits specified in BEXCS are used for accessing addresses outside the specified CS0 to CS3 area. (See 3.6.2 "Chip Select/Wait Control Registers".)
91C820A-100
2006-01-31
TMP91C820A
(4) Address area size specification Table 3.6.1 shows the relationship between CS area and area size. "" indicates areas that cannot be set by memory start address register and address mask register combinations. When setting an area size using a combination indicated by "", set the start address mask register in the desired steps starting from 000000H. If the CS2 area is set to 16 Mbytes or if two or more areas overlap, the smaller CS area number has the higher priority. Example: To set the area size for CS0 to 128 Kbytes: a. Valid start addresses
000000H 020000H 040000H 060000H : 128 Kbytes 128 Kbytes 128 Kbytes Any of these addresses may be set as the start address.
b. Invalid start addresses
000000H 010000H 030000H 050000H : 64 Kbytes 128 Kbytes 128 Kbytes This is not an integer multiple of the desired area size setting. Hence, none of these addresses can be set as the start address.
Table 3.6.1 Valid Area Sizes for Each CS Area Size (bytes) CS area
CS0 CS1 CS2 CS3
256
512
32 K
64 K
128 K 256 K 512 K

1M

2M

4M
8M

Note: "" indicates areas that cannot be set by memory start address register and address mask register combinations.
3.6.2
Chip Select/Wait Control Registers
Figure 3.6.5 lists the chip select/wait control registers. The master enable/disable, chip select output waveform, data bus width and number of wait states for each address area (CS0 to CS3 and others) are set in their respective chip select/wait control registers, B0CS to B3CS and BEXCS.
91C820A-101
2006-01-31
TMP91C820A
Chip Select/Wait Control Registers 7
B0CS (00C0H)
Readmodifywrite instructions are prohibited.
6
5
B0OM1 0
4
B0OM0 0
3
B0BUS W 0
Data bus width 0: 16 bits 1: 8 bits
2
B0W2 0
Number of waits 000: 2 waits 001: 1 wait 010: (1 + N) waits 011: 0 waits
1
B0W1 0
0
B0W0 0
Bit symbol Read/Write After reset Function
B0E W 0
0: Disable 1: Enable
Chip select output waveform selection 00: For ROM/SRAM 01: 10: Don't care 11:
100: Reserved 101: 3 waits 110: 4 waits 111: 8 waits
B1CS (00C1H)
Readmodifywrite instructions are prohibited.
Bit symbol Read/Write After reset Function
B1E W 0
0: Disable 1: Enable
B1OM1 0
B1OM0 0
B1BUS W 0
Data bus width 0: 16 bits 1: 8 bits
B1W2 0
B1W1 0
B1W0 0
Chip select output waveform selection 00: For ROM/SRAM 01: 10: Don't care 11:
Number of waits 000: 2 waits 001: 1 wait 010: (1 + N) waits 011: 0 waits
100: Reserved 101: 3 waits 110: 4 waits 111: 8 waits
B2CS (00C2H)
Readmodifywrite instructions are prohibited.
Bit symbol Read/Write After reset Function
B2E 1
0: Disable 1: Enable
B2M 0
CS2 area selection 0: 16-Mbyte area 1: CS area
B2OM1 0
B2OM0 W 0
B2BUS 0
Data bus width 0: 16 bits 1: 8 bits
B2W2 0
B2W1 0
B2W0 0
Chip select output waveform selection 00: For ROM/SRAM 01: 10: Don't care 11:
Number of waits 000: 2 waits 001: 1 wait 010: (1 + N) waits 011: 0 waits
100: Reserved 101: 3 waits 110: 4 waits 111: 8 waits
B3CS (00C3H)
Readmodifywrite instructions are prohibited.
Bit symbol Read/Write After reset Function
B3E W 0
0: Disable 1: Enable
B3OM1 0
B3OM0 0
B3BUS W 0
Data bus width 0: 16 bits 1: 8 bits
B3W2 0
B3W1 0
B3W0 0
Chip select output waveform selection 00: For ROM/SRAM 01: 10: Don't care 11:
Number of waits 000: 2 waits 001: 1 wait 010: (1 + N) waits 011: 0 waits
100: Reserved 101: 3 waits 110: 4 waits 111: 8 waits
BEXCS (00C7H)
Readmodifywrite instructions are prohibited.
Bit symbol Read/Write After reset Function
BEXBUS 0
Data bus width 0: 16 bits 1: 8 bits
BEXW2 0 0
BEXW1 0
BEXW0 0
Number of waits 000: 2 waits 001: 1 wait 010: (1 + N) waits 011: 0 waits
100: Reserved 101: 3 waits 110: 4 waits 111: 8 waits
Master enable bit
Chip select output waveform selection
Number of address area waits (See 3.6.2 (3) "Wait control".)
0 1
Disable Enable
00 For ROM/SRAM 01 10 Don't care 11
CS2 area selection 0 1 16-Mbyte area Specified address area
Data bus width selection
0 1
16-bit data bus 8-bit data bus
Figure 3.6.5 Chip Select/Wait Control Registers
91C820A-102
2006-01-31
TMP91C820A
(1) Master enable bits Bit 7 (, , or ) of a chip select/wait control register is the master bit, which is used to enable or disable settings for the corresponding address area. Writing 1 to this bit enables the settings. Reset disables (Sets to 0) , and , and enabled (Sets to 1) . This enables area CS2 only.
(2) Data bus width selection Bit 3 (, , , or ) of a chip select/wait control register specifies the width of the data bus. This bit should be set to 0 when memory is to be accessed using a 16-bit data bus and to 1 when an 8-bit data bus is to be used. This process of changing the data bus width according to the address being accessed is known as dynamic bus sizing. For details of this bus operation see Table 3.6.2.
91C820A-103
2006-01-31
CPU Data
D15 to D8
RD WR HWR SRLB SRUB SRWR RD WR HWR SRLB
Control for READ Cycle
R/W R/W
SRUB
Control for WRITE Cycle
SRWR
Operand Operand Memory CPU Data Start Data Bus Address Bus Address Width Width
D7 to D0 b7 to b0 L XXXX XXXX b7 to b0 XXXX XXXX L L L H L H L H H H L H H L H L H b15 to b8 XXXX XXXX b7 to b0 XXXX XXXX b15 to b8 b7 to b0 b15 to b8 b7 to b0 b7 to b0 b15 to b8 XXXX H L H b7 to b0 L H L H L b7 to b0 L H H L H L H L H XXXX
2n + 0
8 bits
2n + 0
(Even number)
16 bits
2n + 0
8 bits
2n + 1 (Odd number)
8 bits
2n + 1
16 bits
2n + 1
2n + 0
8 bits
(Even number)
2n + 0 2n + 1
L L L H L
H L H L H
L L L H L
H L H L H L
16 bits
2n + 0
16 bits
Table 3.6.2 Dynamic Bus Sizing
xxxx: Indicates that the input data from these bits are ignored during a read. During a write, indicates that the bus for these bits
goes to high impedance; also, that the write strobe signal for the bus remains inactive. XXXX XXXX XXXX XXXX L b15 to b8 b31 to b24 b7 to b0 b23 to b16 L b7 to b0 b15 to b8 b23 to b16 b31 to b24 H L H L H L L L L L XXXX XXXX XXXX XXXX b7 to b0 XXXX b23 to b16 b15 to b8 XXXX b31 to b24 b7 to b0 b15 to b8 b23 to b16 b31 to b24 L H L H L H H L L L L H H L L L L H H L L L L H
91C820A-104
2n + 1 (Odd number)
8 bits
2n + 1 2n + 2
16 bits
2n + 1 2n + 2
2n + 0
8 bits
(Even number)
2n + 0 2n + 1 2n + 2 2n + 3
16 bits
2n + 0 2n + 2
32 bits
8 bits
2n + 1 (Odd number)
2n + 1 2n + 2 2n + 3 2n + 4
TMP91C820A
16 bits
2n + 1 2n + 2 2n + 4
2006-01-31
TMP91C820A
(3) Wait control Bits 0 to 2 (, , , , ) of a chip select/wait control register specify the number of waits that are to be inserted when the corresponding memory area is accessed. The following types of wait operation can be specified using these bits. Bit settings other than those listed in the table should not be made. Table 3.6.3 Wait Operation Settings
000 001 010
Number of Waits
2 waits 1 wait (1 + N) waits
Wait Operation
Inserts a wait of 2 states, irrespective of the WAIT pin state. Inserts a wait of 1 state, irrespective of the WAIT pin state. Samples the state of the WAIT pin after inserting a wait of one state. If the WAIT pin is low, the waits continue and the bus cycle is extended until the pin goes high. Ends the bus cycle without a wait, regardless of the WAIT pin state. Invalid setting Inserts a wait of 3 states, irrespective of the WAIT pin state. Inserts a wait of 4 states, irrespective of the WAIT pin state. Inserts a wait of 8 states, irrespective of the WAIT pin state.
011 100 101 110 111
0 waits Reserved 3 waits 4 waits 8 waits
A reset sets these bits to 000 (2 waits). (4) Bus width and wait control for an area other than CS0 to CS3 The chip select/wait control register BEXCS controls the bus width and number of waits when memory locations, which are not in one of the four users specified address areas (CS0 to CS3), are accessed. The BEXCS register settings are always enabled for areas other than CS0 to CS3. (5) Selecting 16-Mbyte area/specified address area Setting B2CS (Bit6 of the chip select/wait control register for CS2) to 0 designates the 16-Mbyte area (000FE0H to 000FFFH, 003000H to FF7FFFH) as the CS2 area. Setting B2CS to 1 designates the address area specified by the start address register MSAR2 and the address mask register MAMR2 as CS2 (e.g., if B2CS = 1, CS2 is specified in the same manner as CS0, CS1 and CS3 are). A reset clears this bit to 0, specifying CS2 as 16-Mbyte address area. (6) Procedure for setting chip select/wait control When using the chip select/wait control function, set the registers in the following order: a. Set the memory start address registers MSAR0 to MSAR3. Set the start addresses for CS0 to CS3. b. Set the memory address mask registers MAMR0 to MAMR3. Set the sizes of CS0 to CS3. c. Set the chip select/wait control registers B0CS to B3CS. Set the chip select output waveform, data bus width, number of waits and master enable/disable status for CS0 to CS3 . The CS0 to S3 pins can also function as pins P60 to P63. To output a chip select signal using one of these pins, set the corresponding bit in the port 6 function register (P6FC) to 1.
91C820A-105
2006-01-31
TMP91C820A
If a CS0 to S3 address is specified which is actually an internal I/O and RAM area address, the CPU accesses the internal address area and no chip select signal is output on any of the CS0 to CS3 pins. Example: In this example CS0 is set to be the 64-Kbyte area 010000H to 01FFFFH. The bus width is set to 16 bits and the number of waits is set to 0. MSAR0 = 01H .......... Start address: 010000H MAMR0 = 07H ......... Address area: 64 Kbytes B0CS = 83H ............. ROM/SRAM, 16-bit data bus, 0 waits, CS0 area settings enabled
3.6.3
Connecting External Memory
Figure 3.6.6 shows an example of how to connect external memory to the TMP91C820A. In this example the ROM is connected using a 16-bit bus. The RAM and I/O are connected using an 8-bit bus.
TMP91C820A
CS0 CS1 CS2
OE
Address bus
CS Upper byte ROM
CS Lower byte ROM OE
CS
8-bit RAM OE WE
CS 8-bit I/O OE WE
A0 to A23 A0-A23 D8 to D15
D0 to D7
RD WR
Figure 3.6.6 Example of External Memory Connection (ROM uses 16-bit bus; RAM and I/O use 8-bit bus.) A reset clears all bits of the port 6 control register (P6CR) and the port 6 function register (P6FC) to 0 and disables output of the CS signal. To output the CS signal, the appropriate bit must be set to 1.
91C820A-106
2006-01-31
TMP91C820A
TMP91C820A 16-bit SRAM
OE LDS UDS
RD SRLB SRUB SRWR CS0
R/W
CE
D [15:0] A0 A1 A2 A3 ... ... Not connect
I/O [16:1] A0 A1 A2 ...
Figure 3.6.7 How to Connect to 16-Bit SRAM for TMP91C820A
91C820A-107
2006-01-31
TMP91C820A
3.7
8-Bit Timers (TMRA)
The TMP91C820A features 4 built-in 8-bit timers. These timers are paired into four modules: TMRA01 and TMRA23. Each module consists of two channels and can operate in any of the following four operating modes. * * * * 8-bit interval timer mode 16-bit interval timer mode 8-bit programmable square wave pulse generation output mode (PPG: Variable duty cycle with variable period) 8-bit pulse width modulation output mode (PWM: Variable duty cycle with constant period)
Figure 3.7.1 and 3.7.2 show block diagrams for TMRA01 and TMRA23. Each channel consists of an 8-bit up counter, an 8-bit comparator and an 8-bit timer register. In addition, a timer flip-flop and a prescaler are provided for each pair of channels. The operation mode and timer flip-flops are controlled by five controls SFRs (Special function registers). Each of the two modules (TMRA01 and TMRA23) can be operated independently. All modules operate in the same manner; hence only the operation of TMRA01 is explained here. The contents of this chapter are as follows. 3.7.1 Block Diagrams 3.7.2 Operation of Each Circuit 3.7.3 SFRs 3.7.4 Operation in Each Mode (1) 8-bit timer mode (2) 16-bit timer mode (3) 8-bit PPG (Programmable pulse generation) output mode (4) 8-bit PWM (Pulse width modulation) output mode (5) Settings for each mode (6) LCDC and MELODY/ALARM circuit supply mode
Table 3.7.1 Registers and Pins for Each Module Module
Input pin for external clock Output pin for timer flip-flop Timer run register SFR (Address) Timer register Timer mode register Timer flip-flop control register
TMRA01
TA0IN (Shared with PB0) TA1OUT (Shared with PB1) TA01RUN (0100H) TA0REG (0102H) TA1REG (0103H) TA01MOD (0104H) TA1FFCR (0105H)
TMRA23
No TA3OUT (Shared with PB5) TA23RUN (0108H) TA2REG (010AH) TA3REG (010BH) TA23MOD (010CH) TA3FFCR (010DH)
External pin
91C820A-108
2006-01-31
3.7.1
Prescaler 2 T1 Timer flip-flop TA1FF TA01RUN Selector T1 T4 T16 8-bit up counter (UC0) 2
over flow
n
Prescaler clock: T0 4 T4 T16 T256 8 16 32 64 128 256 512
Block Diagrams
Run/clear TA01RUN
Selector T1 T16 T256 8-bit up counter (UC1) TA01MOD
TA01RUN TA1FFCR
Timer flip-flop output: TA1OUT
External input clock: TA0IN
Figure 3.7.1 TMRA01 Block Diagram
TA01MOD TA01MOD
91C820A-109
8-bit comparator (CP0) TA01MOD 8-bit timer register TA0REG Match detect TA0TRG TA01RUN Register buffer 0 Internal bus TMRA0 interrupt output: INTTA0 TMRA0 match output: TA0TRG
Match 8-bit comparator detect (CP1)
8-bit timer register TA1REG
Internal bus
TMRA1 interrupt output: INTTA1
TMP91C820A
2006-01-31
Prescaler Prescaler clock: T0 2 T1 T256 Timer flip-flop TA3FF TA23RUN Selector T1 T4 T16 8-bit up counter (UC2) 2 over flow TA23MOD TA23MOD
n
4 T4 T16
8 16 32 64 128 256 512
Run/clear TA23RUN
Selector T1 T16 T256 8-bit up counter (UC3)
TA23RUN TA3FFCR
Timer flip-flop output: TA3OUT (Supply to MLD, LCDC)
Figure 3.7.2 TMRA23 Block Diagram
TA23MOD
91C820A-110
Match 8-bit comparator detect (CP2) TA2TR TA23MOD 8-bit timer register TA2REG TA23RUN Register buffer 2 Internal bus TMRA2 interrupt output: INTTA2 TMRA2 match output: TA2TRG
Match 8-bit comparator detect (CP3)
8-bit timer register TA3REG
Internal bus
TMRA3 interrupt output: INTTA3
TMP91C820A
2006-01-31
TMP91C820A 3.7.2 Operation of Each Circuit
(1) Prescaler A 9-bit prescaler generates the input clock to TMRA01. The clock T0 is divided by 4 and input to this prescaler. T0 can be either fFPH or fc/16 and is selected using the prescaler clock selection register SYSCR0. The prescaler operation can be controlled using TA01RUN in the timer control register. Setting to 1 starts the count; setting to 0 clears the prescaler to 0 and stops operation. Table 3.7.2 shows the various prescaler output clock resolutions.
Table 3.7.2 Prescaler Output Clock Resolution
at fc = 36 MHz, fs = 32.768 kHz
System Prescaler Clock Gear Value Clock Selection Selection
1 (fs) 00 (fFPH) 0 (fc) 10 (fc/16 CLOCK) xxx: Don't care XXX 000 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16) XXX
3 3 4 5 6 7
Prescaler Output Clock Resolution T1
2 /fs (244 s) 2 /fc (0.2 s) 2 /fc (0.4 s) 2 /fc (0.9 s) 2 /fc (1.8 s) 2 /fc (3.6 s) 2 /fc (3.6 s)
7 5
T4
7 7 8 9
T16
11 11 12 13 14 15
T256
2 /fs (62.5 ms) 2 /fc (56.9 s) 2 /fc (113.8 s) 2 /fc (227.6 s) 2 /fc (455.1 s) 2 /fc (910.2 s) 2 /fc (910.2 s)
15
2 /fs (977 s) 2 /fs (3.9 ms) 2 /fc (0.9 s) 2 /fc (3.6 s)
5 6 7 8
2 /fc (1.8 s) 2 /fc (7.1 s) 2 /fc (3.6 s) 2 /fc (14.2 s) 2 /fc (7.1 s) 2 /fc (28.4 s)
10 11
2 /fc (14.2 s) 2 /fc (56.9 s)
9
2 /fc (14.2 s) 2 /fc (56.9 s)
9 11
(2) Up counters (UC0 and UC1) These are 8-bit binary counters which count up the input clock pulses for the clock specified by TA01MOD. The input clock for UC0 is selectable and can be either the external clock input via the TA0IN pin or one of the three internal clocks T1, T4 or T16. The clock setting is specified by the value set in TA01MOD. The input clock for UC1 depends on the operation mode. In 16-bit timer mode, the overflow output from UC0 is used as the input clock. In any mode other than 16-bit timer mode, the input clock is selectable and can either be one of the internal clocks T1, T16 or T256, or the comparator output (The match detection signal) from TMRA0. For each interval timer the timer operation control register bits TA01RUN and TA01RUN can be used to stop and clear the up counters and to control their count. A reset clears both up counters, stopping the timers.
91C820A-111
2006-01-31
TMP91C820A
(3) Timer registers (TA0REG and TA1REG) These are 8-bit registers, which can be used to set a time interval. When the value set in the timer register TA0REG or TA1REG matches the value in the corresponding up counter, the comparator match detect signal goes active. If the value set in the timer register is 00H, the signal goes active when the up counter overflows. The TA0REG are double buffer structure, each of which makes a pair with register buffer. The setting of the bit TA01RUN determines whether TA0REG's double buffer structure is enabled or disabled. It is disabled if = 0 and enabled if = 1. When the double buffer is enabled, data is transferred from the register buffer to the timer register when a 2n overflow occurs in PWM mode, or at the start of the PPG cycle in PPG mode. Hence the double buffer cannot be used in timer mode. A reset initializes to 0, disabling the double buffer. To use the double buffer, write data to the timer register, set to 1, and write the following data to the register buffer. Figure 3.7.3 shows the configuration of TA0REG.
Selector B Y Shift trigger Register buffers 0 Write Internal data bus TA01RUN S A Write to TA0REG Matching detection in PPG cycle n 2 overflow of PWM
Timer registers 0 (TA0REG)
Figure 3.7.3 Configuration of TA0REG Note: The same memory address is allocated to the timer register and the register buffer. When = 0, the same value is written to the register buffer and the timer register; when = 1, only the register buffer is written to.
The address of each timer register is as follows. TA0REG: 000102H TA2REG: 00010AH TA1REG: 000103H TA3REG: 00010BH
All these registers are write only and cannot be read.
91C820A-112
2006-01-31
TMP91C820A
(4) Comparator (CP0) The comparator compares the value in an up counter with the value set in a timer register. If they match, the up counter is cleared to 0 and an interrupt signal (INTTA0 or INTTA1) is generated. If timer flip-flop inversion is enabled, the timer flip-flop is inverted at the same time.
(5) Timer flip-flop (TA1FF) The timer flip-flop (TA1FF) is a flip-flop inverted by the match detects signal (8-bit comparator output) of each interval timer. Whether inversion is enabled or disabled is determined by the setting of the bit TA1FFCR in the timer flip-flops control register. A reset clears the value of TA1FF to 0. Writing 01 or 10 to TA1FFCR sets TA1FF to 0 or 1. Writing 00 to these bits inverts the value of TA1FF. (This is known as software inversion.) The TA1FF signal is output via the TA1OUT pin. When this pin is used as the timer output, the timer flip-flop should be set beforehand using the port B function register PBCR, PBFC. Note: When the double buffer is enabled for an 8-bit timer in PWM or PPG mode, caution is required as explained below. If new data is written to the register buffer immediately before an overflow occurs by a match between the timer register value and the up-counter value, the timer flip-flop may output an unexpected value. For this reason, make sure that in PWM mode new data is written to the register buffer by six cycles (fSYS x 6) before the next overflow occurs by using an overflow interrupt. In the case of using PPG mode, make sure that new data is written to the register buffer by six cycles before the next cycle compare match occurs by using a cycle compare match interrupt. Example when using PWM mode
Match between TA0REG and up-counter 2 overflow interrupt (INTTA0) TA1OUT tPWM (PWM cycle) Desired PWM cycle change point Write new data to the register buffer before the next overflow occurs by using an overflow interrupt
n
91C820A-113
2006-01-31
TMP91C820A 3.7.3 SFRs
TMRA01 Run Register
7
TA01RUN (0100H) Bit symbol Read/Write After reset Function TA0RDE R/W 0 Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA01 0
2
TA01PRUN
1
TA1RUN 0 R/W
0
TA0RUN 0
0
8-bit timer run/stop control IDLE2 0: Stop and clear 0: Stop 1: Operate 1: Run (Count up)
TA0REG double buffer control 0 1 Disable Enable
Timer run/stop control 0 1 Stop and clear Run (Count up)
I2TA01: Operation in IDLE2 mode TA01PRUN: Run prescaler TA1RUN: Run TMRA1 TA0RUN: Run TMRA0 Note: The values of bits 4 to 6 of TA01RUN are undefined when read.
TMRA23 Run Register
7
TA23RUN (0108H) Bit symbol Read/Write After reset Function TA2RDE R/W 0 Double buffer 0: Disable 1: Enable
6
5
4
3
I2TA23 0
2
TA23PRUN
1
TA3RUN 0 R/W
0
TA2RUN 0
0
8-bit timer run/stop control IDLE2 0: Stop and clear 0: Stop 1: Operate 1: Run (Count up)
TA2REG double buffer control 0 1 Disable Enable
Timer run/stop control 0 1 Stop and clear Run (Count up)
I2TA23: Operation in IDLE2 mode TA23PRUN: Run prescaler TA3RUN: Run TMRA3 TA2RUN: Run TMRA2 Note: The values of bits 4 to 6 of TA23RUN are undefined when read.
Figure 3.7.4 Register for TMRA
91C820A-114
2006-01-31
TMP91C820A
TMRA01 Mode Register
7
TA01MOD Bit symbol (0104H) Read/Write After reset Function TA01M1 0 Operation mode
6
TA01M0 0
5
PWM01 0 PWM cycle 00: Reserved 6 01: 2 10: 2 11: 2
7 8
4
PWM00 0 R/W
3
TA1CLK1 0 00: TA0TRG 01: T1 10: T16 11: T256
2
TA1CLK0 0
1
TA0CLK1 0 00: TA0IN pin 01: T1 10: T4 11: T16
0
TA0CLK0 0
Source clock for TMRA1
Source clock for TMRA0
00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
TMRA0 source clock selection 00 01 10 11 TA0IN (External input) T1 (Prescaler) T4 (Prescaler) T16 (Prescaler)
TMRA1 source clock selection TA01MOD 01 00 01 10
Comparator output from TMRA0
TA01MOD = 01
Overflow output from TMRA0
T1 T16
(16-bit timer mode)
11 T256 PWM cycle selection 00 01 10 Reserved 2 x source clock
6 7 8
2 x source clock
11 2 x source clock TMRA01 operation mode selection 00 01 10 11 Two 8-bit timers 16-bit timer 8-bit PPG 8-bit PWM (TMRA0) + 8-bit timer (TMRA1)
Figure 3.7.5 Register for TMRA
91C820A-115
2006-01-31
TMP91C820A
TMRA23 Mode Register
7
TA23MOD Bit symbol (010CH) Read/Write After reset Function TA23M1 0 Operation mode
6
TA23M0 0
5
PWM21 0 PWM cycle 00: Reserved 6 01: 2 10: 2 11: 2
7 8
4
PWM20 0 R/W
3
TA3CLK1 0 00: TA2TRG 01: T1 10: T16 11: T256
2
TA3CLK0 0
1
TA2CLK1 0 00: Reserved 01: T1 10: T4 11: T16
0
TA2CLK0 0
TMRA3 clock for TMRA3
TMRA2 clock for TMRA2
00: 8-bit timer mode 01: 16-bit timer mode 10: 8-bit PPG mode 11: 8-bit PWM mode
TMRA2 source clock selection 00 01 10 11 Do not set T1 (Prescaler) T4 (Prescaler) T16 (Prescaler)
TMRA3 source clock selection TA23MOD 01 00 01 10 11 Comparator output from TMRA2 T1 T16 T256 (16-bit timer mode) TA23MOD = 01 Overflow output from TMRA2
PWM cycle selection 00 01 10 11 Reserved 2 x source clock
6 7 8
2 x source clock 2 x source clock
TMRA23 operation mode selection 00 01 10 11 Two 8-bit timers 16-bit timer 8-bit PPG 8-bit PWM (TMRA2) + 8-bit timer (TMRA3)
Figure 3.7.6 Register for TMRA
91C820A-116
2006-01-31
TMP91C820A
TMRA1 Flip-Flop Control Register
7
TA1FFCR (0105H) Bit symbol Read/Write After reset Function
Readmodifywrite instructions are prohibited.
6
5
4
3
TA1FFC1 1 00: Invert TA1FF 01: Set TA1FF 10: Clear TA1FF 11: Don't care R/W
2
TA1FFC0 1
1
TA1FFIE 0 TA1FF control for inversion 0: Disable 1: Enable R/W
0
TA1FFIS 0 TA1FF inversion select 0: TMRA0 1: TMRA1
Inverse signal for timer flip-flop 1 (TA1FF) (Don't care except in 8-bit timer mode) 0 1 Inversion by TMRA0 Inversion by TMRA1
Inversion of TA1FF 0 1 Disabled Enabled
Control of TA1FF 00 01 10 11 Inverts the value of TA1FF Sets TA1FF to 1 Clears TA1FF to 0 Don't care
Figure 3.7.7 Register for TMRA
91C820A-117
2006-01-31
TMP91C820A
TMRA3 Flip-Flop Control Register
7
TA3FFCR (010DH) Bit symbol Read/Write After reset Function
Readmodifywrite instructions are prohibited.
6
5
4
3
TA3FFC1 1 00: Invert TA3FF 01: Set TA3FF 10: Clear TA3FF 11: Don't care R/W
2
TA3FFC0 1
1
TA3FFIE 0 TA3FF control for inversion 0: Disable 1: Enable R/W
0
TA3FFIS 0 TA3FF inversion select 0: TMRA2 1: TMRA3
Inverse signal for timer flip-flop 3 (TA3FF) (Don't care except in 8-bit timer mode) 0 1 Inversion by TMRA2 Inversion by TMRA3
Inversion of TA3FF 0 1 Disabled Enabled
Control of TA3FF 00 01 10 11 Inverts the value of TA3FF Sets TA3FF to 1 Clears TA3FF to 0 Don't care
Figure 3.7.8 Register for TMRA
91C820A-118
2006-01-31
TMP91C820A
TMRA register 7
TA0REG (0102H) bit Symbol Read/Write After reset TA1REG (0103H) bit Symbol Read/Write After reset TA2REG (010AH) bit Symbol Read/Write After reset TA3REG (010BH) bit Symbol Read/Write After reset
6
5
4
- W Undefined - W Undefined - W Undefined - W Undefined
3
2
1
0
Note: The above registers are prohibited read-modify-write instruction.
Figure 3.7.9 Register for TMRA
91C820A-119
2006-01-31
TMP91C820A 3.7.4 Operation in Each Mode
(1) 8-bit timer mode Both TMRA0 and TMRA1 can be used independently as 8-bit interval timers. a. Generating interrupts at a fixed interval (Using TMRA1) To generate interrupts at constant intervals using TMRA1 (INTTA1), first stop TMRA1 then set the operation mode, input clock and a cycle to TA01MOD and TA1REG register respectively. Then, enable the interrupt INTTA1 and start TMRA1 counting.
Example: To generate an INTTA1 interrupt every 8.0 s at fc = 36 MHz, set each register as follows: * Clock state System clock: High frequency (fc) Prescaler clock: fFPH MSB 7 TA01RUN TA01MOD TA1REG INTETA01 TA01RUN - 0 0 X - 6 - 0 0 1 X 5 X X 1 0 X 4 X X 0 1 X 3 - 1 1 - - LSB 2 - 0 0 - 1 1 0 - 0 - 1 0 - - 0 - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (0.2 s at fc = 36 MHz) as the input clock. Set TA1REG to 8.0 s / T1 = 40 = 28H. Enable INTTA1 and set it to level 5. Start TMRA1 counting.
X: Don't care, -: No change
Select the input clock using Table 3.7.2. Note: The input clocks for TMRA0 and TMRA1 are different from as follows. TMRA0: TA0IN input, T1, T4 or T16. TMRA1: Match output of TMRA0, T1, T16, T256.
91C820A-120
2006-01-31
TMP91C820A
b. Generating a 50% duty ratio square wave pulse The state of the timer flip-flop (TA1FF) is inverted at constant intervals and its status output via the timer output pin (TA1OUT).
Example: To output a 1.2 s square wave pulse from the TA1OUT pin at fc = 36MHz, use the following procedure to make the appropriate register settings. This example uses TMRA1; however, either TMRA0 or TMRA1 may be used. * Clock state System clock: Clock gear: High frequency (fc) 1 (fc)
Prescaler clock: fFPH 7 TA01RUN TA01MOD TA1REG TA1FFCR PBCR PBFC TA01RUN - 0 0 X X X - 6 X 0 0 X - - X 5 X X 0 X - - X 4 X X 0 X - - X 3 - 0 0 1 - - - 2 - 1 0 0 X X 1 1 0 - 1 1 1 1 1 0 - - 1 1 - - - Stop TMRA1 and clear it to 0. Select 8-bit timer mode and select T1 (0.2 s at fc = 36 MHz) as the input clock. Set the timer register to 1.2 s / T1 / 2 = 3. Clear TA1FF to 0 and set it to invert on the match detects signal from TMRA1. Set PB1 to function as the TA1OUT pin. Start TMRA1 counting.
X: Don't care, -: No change
T1
TA01RUN Bit7 to 2 Up counter Bit1 Bit0 Comparator timing Comparator output (Match detect) INTTA1 UC1 clear
0
1
2
3
0
1
2
3
0
1
2
3
0
TA1FF
TA1OUT
0.6 s at fc = 36 MHz
Figure 3.7.10 Square Wave Output Timing Chart (50% duty)
91C820A-121
2006-01-31
TMP91C820A
c. Making TMRA1 count up on the match signal from the TMRA0 comparator Select 8-bit timer mode and set the comparator output from TMRA0 to be the input clock to TMRA1.
Comparaot output (TMRA0 match) TMRA0 up counter (When TA0REG = 5) TMRA1 up counter (When TA1REG = 2) TMRA1 match output 1 2 3 1 4 5 1 2 3 2 4 5 1 2 1 3
Figure 3.7.11 TMRA1 Count Up on Signal from TMRA0
91C820A-122
2006-01-31
TMP91C820A
(2) 16-bit timer mode Pairing the two 8-bit timers TMRA0 and TMRA1 configures a 16-bit interval timer. To make a 16-bit interval timer in which TMRA0 and TMRA1 are cascaded together, set TA01MOD to 01. In 16-bit timer mode, the overflow output from TMRA0 is used as the input clock for TMRA1, regardless of the value set in TA01MOD. Table 3.7.2 shows the relationship between the timer (Interrupt) cycle and the input clock selection.
Setting example: To generate an INTTA1 interrupt every 0.22 s at fc = 36 MHz, set the timer registers TA0REG and TA1REG as follows:
* Clock state
System clock: High frequency (fc) Clock gear: 1 (fc) Prescaler clock: fFPH
If T16 ((27/fc)s at 36 MHz) is used as the input clock for counting, set the following value in the registers: 0.22 s /(27/fc)s 62500 = F424H (e.g. set TA1REG to F4H and TA0REG to 24H). As a result, INTTA1 interrupt can be generated every 0.23 [s]. The comparator match signal is output from TMRA0 each time the up counter UC0 matches TA0REG, though the up counter UC0 is not be cleared. In the case of the TMRA1 comparator, the match detect signal is output on each comparator pulse on which the values in the up counter UC1 and TA1REG match. When the match detect signal is output simultaneously from both the comparator TMRA0 and TMRA1, the up counters UC0 and UC1 are cleared to 0 and the interrupt INTTA1 is generated. Also, if inversion is enabled, the value of the timer flip-flop TA1FF is inverted. Example: When TA1REG = 04H and TA0REG = 80H
Value of up counter (UC1, UC0) TMRA0 comparator match detect signal TMRA0 comparator match detect signal INTTA0 INTTA1 TA1OUT
0080H
0180H
0280H
0380H
0480H
0080H
Inversion
Figure 3.7.12 Timer Output by 16-Bit Timer Mode
91C820A-123
2006-01-31
TMP91C820A
(3) 8-bit PPG (Programmable pulse generation) output mode Square wave pulses can be generated at any frequency and duty ratio by TMRA0. The output pulses may be active-low or active-high. In this mode TMRA1 cannot be used. TMRA0 outputs pulses on the TA1OUT pin.
tH When ="10" t tL When ="01" t
tL
tH
Example when ="01" TA0REG and UC0 match (Interrupt INTTA0) TA1REG and UC0 match (Interruput INTTA1) TA1OUT TA0REG TA1REG
Figure 3.7.13 8-Bit PPG Output Waveforms
91C820A-124
2006-01-31
TMP91C820A
In this mode a programmable square wave is generated by inverting the timer output each time the 8-bit up counter (UC0) matches the value in one of the timer registers TA0REG or TA1REG. The value set in TA0REG must be smaller than the value set in TA1REG. Although the up counter for TMRA1 (UC1) is not used in this mode, TA01RUN should be set to 1 so that UC1 is set for counting. Figure 3.7.14 shows a block diagram representing this mode.
TA1OUT
TA0IN T1 T4 T16
Selector
TA01RUN 8-bit up counter (UC 0) TA1FF TA1FFCR
Inversion INTTA0 Comparator INTTA1
TA01MOD
Comparator
Selector TA0REG-WR
TA0REG Shift trigger Register buffer TA1REG
TA01RUN Internal data bus
Figure 3.7.14 Block Diagram of 8-Bit PPG Output Mode If the TA0REG double buffer is enabled in this mode, the value of the register buffer will be shifted into TA0REG each time TA1REG matches UC0. Use of the double buffer facilitates the handling of low-duty waves (when duty is varied).
Match with TA0REG and up counter Match with TA1REG TA0REG (Value to be compared) Register buffer
(Up counter = Q1)
(Up countner = Q2) Shift from register buffer Q2 Q2 Q3 TA0REG (Register buffer) write
Q1
Figure 3.7.15 Operation of Register Buffer
91C820A-125
2006-01-31
TMP91C820A
Example: To generate 1/4 duty 50 kHz pulses (at fc = 36 MHz):
20 s
* Clock state
System clock: High frequency (fc) Clock gear: 1 (fc) Prescaler clock: fFPH
Calculate the value, which should be set in the timer register. To obtain a frequency of 50 kHz, the pulse cycle t should be: t = 1/50 kHz = 20 s T1 = (23/fc)s (at 36 MHz); 20 s / (23/fc)s 90 Therefore set TA1REG to 90 (5AH) The duty is to be set to 1/4: t x 1/4 = 20 s x 1/4 = 5 s 5 s / (23/fc)s 22 Therefore, set TA0REG = 22= 16H.
7 0 1 0 0 X 6 X 0 0 1 X - - X 5 X X 0 0 X - - X 4 X X 1 1 X - - X 3 - X 0 1 0 - - - 2 0 X 1 0 1 X X 1 1 0 0 1 1 1 1 1 1 0 0 1 0 0 X - - 1
TA01RUN TA01MOD TA0REG TA1REG TA1FFCR PBCR PBFC TA01RUN

Stop TMRA0 and TMRA01 and clear it to 0. Set the 8-bit PPG mode, and select T1 as input clock. Write16H. Write 5AH. Set TA1FF, enabling both inversion and the double buffer. Writing 10 provides negative logic pulse. Set PB1 as the TA1OUT pin. Start TMRA0 and TMRA01 counting.
X X 1
X: Don't care, -: No change
91C820A-126
2006-01-31
TMP91C820A
(4) 8-bit PWM (Pulse width modulation) output mode This mode is only valid for TMRA0. In this mode, a PWM pulse with the maximum resolution of 8 bits can be output. When TMRA0 is used the PWM pulse is output on the TA1OUT pin. TMRA1 can also be used as an 8-bit timer. The timer output is inverted when the up counter (UC0) matches the value set in the timer register TA0REG or when 2n counter overflow occurs (n = 6, 7 or 8 as specified by TA01MOD). The up counter UC0 is cleared when 2n counter overflow occurs. The following conditions must be satisfied before this PWM mode can be used. Value set in TA0REG < Value set for 2n counter overflow Value set in TA0REG 0
TA0REG and UC0 match 2 overflow (INTTA0 interrupt) TA1OUT tPWM (PWM cycle)
n
Figure 3.7.16 8-Bit PWM Waveforms Figure 3.7.17 shows a block diagram representing this mode.
TA1OUT TA1FFCR
TA01RUN
TA0IN T1 T4 T16
Selector
8-bit up counter (UC0)
Clear 2 overflow control
n
TAFF1 Invert TA01MOD Overflow
TA01MOD
Comparator INTTA0 TA0REG
Selector
TA0REG-WR
Shift trigger Register buffer
TA01RUN Internal data bus
Figure 3.7.17 Block Diagram of 8-Bit PWM Mode
91C820A-127
2006-01-31
TMP91C820A
In this mode the value of the register buffer will be shifted into TA0REG if 2n overflow is detected when the TA0REG double buffer is enabled. Use of the double buffer facilitates the handling of low duty ratio waves.
Match with TA0REG 2 overflow TA0REG (Value to be compared) Register buffer Q1 Q2 Shift into TA0REG Q2 Q3 TA0REG (Register buffer) write
n
Up counter = Q1
Up counter = Q2
Figure 3.7.18 Register Buffer Operation
Example: To output the following PWM waves on the TA1OUT pin at fc = 36 MHz:
16.0 s 28.4 s
* Clock state
System clock: High frequency (fc) Clock gear: 1 (fc) Prescaler clock: fFPH
To achieve a 28.4 s PWM cycle by setting T1 to (23/fc)s (at fc = 36 MHz): 28.4 s / (23/fc)s 128 = 2n Therefore n should be set to 7. Since the low-level period is 16.0 s when T1 = 0.5 s, set the following value for TA0REG: 16.0 s / (23/fc)s 72 = 48H
MSB 7 - 1 0 X X X 1 LSB 10 -0 01 0 1 1 1 - 0 X - - 1
TA01RUN TA01MOD TA0REG TA1FFCR PBCR PBFC TA01RUN
6 X 1 1 X - - X
5 X 1 0 X - - X
4 X 0 0 X - - X
3 - - 1 1 - - -
2 - - 0 0 X X 1
Stop TMRA0 and clear it to 0. 7 Select 8-bit PWM mode (cycle: 2 ) and select T1 as the input clock. Write 48H. Clear TA1FF to 0; enable the inversion and double buffer.
Set PB1 and the TA1OUT pin. Start TMRA0 counting.
X: Don't care, -: No change
91C820A-128
2006-01-31
TMP91C820A
Table 3.7.3 PWM Cycle
at fc = 36 MHz, fs = 32.768 kHz Select Select Gear value system prescaler clock clock 1 (fs) 00 (fFPH) 0 (fc) 10 (fc/16 Clock) XXX: Don't care XXX 000 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16) XXX PWM cycle 2 T1
6
2 T16 227 s 455 s 910 s T1 28.4 s 56.8 s 113 s
7
2 T16 455 s 910 s T1 56.8 s 113 s 227 s 455 s 910 s 910 s
8
T4
T4
T4 250 ms 227 s 455 s 910 s 1820 s
T16 1000 ms 910 s 1820 s 3640 s 7281 s
15.6 ms 62.5 ms 250 ms 31.3 ms 125 ms 500 ms 62.5 ms 14.2 s 56.8 s 28.4 s 56.8 s 113 s 227 s 227 s 113 s 227 s 113s 227 s
455 s 1820 s 910 s 3640 s
455 s 1820 s 227 s
910 s 3640 s 455 s 1820 s 7281 s 910 s 3640 s 455 s 1820 s 7281 s
3640 s 14563 s 3640 s 14563 s
(5) Settings for each mode Table 3.7.4 shows the SFR settings for each mode. Table 3.7.4 Timer Mode Setting Registers
Register Name Function Timer Mode TA01MOD PWM Cycle Upper Timer Input Clock Lower timer match T1, T16, T256 (00, 01, 10, 11) - Lower Timer Input Clock External clock T1, T4, T16 (00, 01, 10, 11) External clock T1, T4, T16 (00, 01, 10, 11) External clock T1, T4, T16 (00, 01, 10, 11) External clock T1, T4, T16 (00, 01, 10, 11) - TA1FFCR TA1FFIS Timer F/F Invert Signal Select 0: Lower timer output 1: Upper timer output
8-bit timer x 2 channels
00
-
16-bit timer mode
01
-
-
8-bit PPG x 1 channel
10
-
-
-
8-bit PWM x 1 channel 8-bit timer x 1 channel -: Don't care
11
2 ,2 ,2 (01, 10, 11) -
6
7
8
- T1, T16, T256 (01, 10, 11)
-
11
Output disabled
91C820A-129
2006-01-31
TMP91C820A
(6) LCDC and MELODY/ALARM circuit supply mode This function can operate only TMRA3. It can use LCDC or MELODY/ALARM source clock TA3 clock generated by TMRA3. And keep the rule under below.
OPERATE 1. Clock generate by timer 3 2. Clock supply start ( = 1 or = 1) 3. Need setup time 4. LCDC or MELODY/ALARM start to operate
STOP 1. LCDC or MELODY/ALARM stop to operate 2. Clock supply cut off ( = 0 or = 0)
7
EMCCR0 (00E3H) Bit symbol Read/Write After reset Function R 0
Protect flag 0: OFF 1: ON
6
R/W 0
LCDC source clock hold 0: 32 kHz 1: TA3OUT
5
AHOLD R/W 0
Address
4
R/W 0
source clock 0: 32 kHz 1: TA3OUT
3
R/W 0
0: Disable 1: Enable
2
EXTIN R/W 0
1: External clock
1
DRVOSCH
0
DRVOSCL
PROTECT TA3LCDE
TA3MLDE HRESENA
R/W 1
fc oscillator driver ability 1: Normal 0: Weak
R/W 1
fs oscillator driver ability 1: Normal 0: Weak
Melody/alarm HRESET
0: Normal 1: Enable
91C820A-130
2006-01-31
TMP91C820A
3.8
External Memory Extension Function (MMU)
This is MMU function which can expand program/data area to 136 Mbytes by having 4 local areas. Address pins to external memory are 2 extended address bus pins (EA24, EA25) and 8 extended chip select pins ( CS2A to CS2G and CSEXA ) in addition to 24 address bus pins (A0 to A23) which are common specification of TLCS-900 family and 4 chip select pins ( CS0 to CS3 ) output from CS/WAIT controller. The feature and the recommendation setting method of two types are shown below. In addition, "AH" in the table is the value which number address 23 to 16 displayed as hex.
Purpose
Item
Maximum memory size
Recommendation setting method
16Mbytes (16 Mbytes x 1 pcs) LOCAL2 (AH = C0 - DF: 2 Mbytes x 7 BANK) Setup AH = 80 - FF to CS2
CS2A
Program ROM
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
96 Mbytes (16 Mbytes x 6 pcs) LOCAL3 (AH = 80 - BF: 4 Mbytes x 24 BANK) Setup AH = 80 - FF to CS2
CS2B , CS2C , CS2D , CS2E , CS2F , CS2G
Data ROM
Used local area, BANK number Setting CS/WAIT Used CS pins Maximum memory size
16 Mbyte (16 Mbytes x 1 pcs) LOCAL1 (AH = 40 - 5F: 2 Mbytes x 7 BANK) Setup AH = 40 - 7F to CS1
CS1
Option program ROM
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
8 Mbytes (8 Mbytes x 1pcs) LOCAL0 (AH = 10 - 1F: 1 Mbyte x 7 BANK) Setup AH = 00 - 1F to CS3
CS3
Data RAM
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
1 Mbyte (1 Mbyte x 1 pcs) None Setup AH = 20 - 2F to CS0
CS0
Extended memory 1
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
256 Kbytes (256 Kbytes x 1 pcs) None Setup AH = 30 - 3F to CSEX
CSEXA
Extended memory 2
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
256 Kbytes (64 Kbytes x 4 pcs) None Setup AH = 30 - 3F to CSEX D1BSCP, D2BLP, D3BFR, DLEBCD 512 Kbytes None Setup AH = 30 - 3F to CSEX None
Extended memory 3 (Direct address assigned built-in type LCD driver)
Used local area, BANK number Setting CS/WAIT Used CS pin Maximum memory size
Extended memory 4
Used local area, BANK number Setting CS/WAIT Used CS pin
Note: SDRAM must be mapped in LOCAL1 area. It can't use other area.
91C820A-131
2006-01-31
TMP91C820A 3.8.1 Recommendable Memory Map
The recommendation logic address memory map at the time of variety extension memory correspondence is shown in Figure 3.8.1. And, a physical-address map is shown in Figure 3.8.2. However, when memory area is less than 16 Mbytes and is not expanded, please refer to section of CS/WAIT controller. Setting of register in MMU is not necessary. The area which can be set as Bank is called local-area. While the area for managing the Bank is called common-area. Since they are being fixed, the address of a common-area and a local-area cannot be changed.
Address 000000H 100000H 200000H 300000H 380000H 3C0000H 3D0000H 3E0000H 3F0000H 400000H Size
1 Mbyte 1 Mbyte 1 Mbyte 512 Kbytes 256 Kbytes 64 Kbytes 64 Kbytes 64 Kbytes 64 Kbytes
Memory map
BANK
CS/WAIT
CS
pin
COMMON0 LOCAL0 0 1 2 3 4 5 6 7
CS3 CS0 CSEX CSEX CSEX CSEX CSEX CSEX
CS3 CS0
-
CSEXA
D1BSC D2BLP D3BFR DLEBCD
0
2 Mbytes
1
2
3
4
5
6
7
LOCAL1 CS1
CS1
600000H
2 Mbytes
COMMON1 0 1 2 ... 22 23
CS2B (BANK0 to BANK3) CS2C (BANK4 to BANK7) CS2D (BANK8 to BANK11) CS2E (BANK12 to BANK15) CS2F (BANK16 to BANK19) CS2G (BANK20 to BANK23)
800000H
4 Mbytes
LOCAL3
CS2
C00000H
2 Mbytes
0 LOCAL2
1
2
3
4
5
6
7
E00000H CS2A
2 Mbytes CS2A
COMMON2 : Internal area
FFFF00H FFFFFFH
256 bytes
Vector area
: Overlapped with COMMON area
Figure 3.8.1 Recommendation Address Map (Physical address)
91C820A-132
2006-01-31
TMP91C820A
LOCAL0
CS3
LOCAL1
CS1
LOCAL2
CS2A
LOCAL3
CS2B
for data RAM (SDRAM non support) (8 Mbytes) BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7 800000H
for option program ROM (SDRAM support) (16 Mbytes) BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7
for program ROM (16 Mbytes)
for data ROM (16 Mbytes x 6)
CS2E
BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7 BANK3
CS2C CS2F
BANK0
BANK12
BANK1
BANK13
BANK2
BANK14
BANK15
1000000H 000000H Reset and interrupt vector area
BANK4
BANK16
BANK5
BANK17
BANK6
BANK18
1000000H
CS2D
BANK7
BANK19
CS2G
000000H
BANK8
BANK20
BANK9
BANK21
: Overlapped with COMMON area BANK10 BANK22
1000000H
BANK11
BANK23
Figure 3.8.2 Physical Address Map
91C820A-133
2006-01-31
TMP91C820A 3.8.2 Explanation of SFR
There are 4 registers; LOCAL0 to LOCAL3. Each register is for enabling bank and setting bank. Setup LOCAL registers in common area. And, a combination pin and the CS/WAIT controller need to be set. When CPU outputs logical address of the LOCAL area, MMU outputs physical address to the outside address bus pin according to value of bank setting register. Access of external memory becomes possible therefore.
LOCAL0 Register
7
LOCAL0 (0350H) Bit symbol Read/Write After reset Function L0E R/W 0 BANK for LOCAL0 0: Disable 1: Enable
6
5
4
3
2
L0EA22 0
1
L0EA21 R/W 0
0
L0EA20 0
Setting BANK number for LOCAL0 Do not set "000" because of common area LOCAL1 Register
7
LOCAL1 (0351H) Bit symbol Read/Write After reset Function L1E R/W 0 BANK for LOCAL1 0: Disable 1: Enable
6
5
4
3
2
L1EA23 0
1
L1EA22 R/W 0
0
L1EA21 0
Setting BANK number for LOCAL1 Do not set "001" because of common area LOCAL2 Register
7
LOCAL2 (0352H) Bit symbol Read/Write After reset Function L2E R/W 0 BANK for LOCAL2 0: Disable 1: Enable
6
5
4
3
2
L2EA23 0
1
L2EA22 R/W 0
0
L2EA21 0
Setting BANK number for LOCAL2 Do not set "111" because of common area LOCAL3 Register
7
LOCAL3 (0353H) Bit symbol Read/Write After reset Function L3E R/W 0 BANK for LOCAL3 0: Disable 1: Enable
6
5
4
L3EA26 R/W 0
3
L3EA25 R/W 0
2
L3EA24 R/W 0
1
L3EA23 R/W 0
0
L3EA22 R/W 0
01000 to 01011: CS2D 00000 to 00011: CS2B 00100 to 00111: CS2C
01100 to 01111: CS2E 10000 to 10011: CS2F 10100 to 10111: CS2G
11000 to 11111: Set prohibition
Figure 3.8.3 Register for LOCAL0 to LOCAL3
91C820A-134
2006-01-31
TMP91C820A
Data/stack SRAM SRAM 8 Mbytes 8 bits
CS0 CS3
000000H to 1FFFFFH (Logical) 000000H to 7FFFFFH (Physical)
Display SDRAM
CS1
SDRAM 16 Mbytes 16 bits
CS1
400000H to 7FFFFFH (Logical) 000000H to FFFFFFH (Physical)
Data Address TMP91C820A
RD , ( WR , HWR : SRAM)
Program ROM SDCLK, SDCKE, SDLDQM, SDUDQM SDCS , SDRAS , SDCAS
SDWE CS2
MROM 16 Mbytes 16 bits
CS2
C00000H to FFFFFFH (Logical) 000000H to FFFFFFH (Physical)
EA24, EA25
CS3
Data ROM
CS3
MROM 64 Mbytes 16 bits
800000H to BFFFFFH (Logical) 0000000H to 3FFFFFFH (Physical)
* In case of 16-bit bus memory
* In case of 8-bit bus memory
TMP91C820A
Control signals D [0:15] A0 A1 A2 A16
Memory
Control signals D [0:15] Open A0 A1 A15
TMP91C820A
Control signals D [0:7] A0 A1 A2 A7
Memory
Control signals D [0:7] A0 A1 A2 A7
: :
: :
Figure 3.8.4 H/W Setting Example At Figure 3.8.4, it shows example of connection TMP91C820A and some memories: program ROM: MROM, 16 Mbyte, data ROM: MROM, 64 Mbyte, data RAM: SRAM, 8 Mbyte, 8-bit bus, display RAM: SDRAM, 16 Mbytes. In case of 16-bit bus memory connection, it need to shift 1-bit address bus from TMP91C820A and 8-bit bus case, direct connection address bus from TMP91C820A. In that figure, logical address and physical address are shown. And each memory allot each chip select signal, RAM: CS0 , SDRAM: CS1 , program MROM: CS2 , data MROM: CS3 in case of this example, as data MROM is 64 Mbyte, this MROM connect to EA24 and EA25. Initial condition after reset, because TMP91C820A access from CS2 area, CS2 area allots to program ROM. It can set free setting except program ROM.
91C820A-135
2006-01-31
TMP91C820A
;Initial Setting ;CS0 LD LD LD ;CS1 LD LD LD ;CS2 LD LD LD ;CS3 LD LD LD ;CSX LD ;Port LD LD to LDW LD LD to LD LD (SDACR),06DH (SDRCR),01H (PZCR),0707H (PFFC),7FH (SDACR),0ADH ; HWR , WR , RD ; PF [6:0] = SDRAM control ; Add-MUX enable, 128-M select ; SDRAM setup time ; Add MUX enable, 128-M select ; Interval reflesh (P6FC),3FH (P6FC2),02H ; CS0 to CS3 , EA24, EA25: port 6 setting ; CS1 SDCS setting (BEXCS),00H ; Other: 16 bits, 2 waits (Don't care) (MSAR3),80H (MAMR3),7FH (B3CS),85H ; Logical address area: 800000H to BFFFFFH ; Logical address size: 4 Mbytes ; Condition: 16 bits, 3 waits (64 Mbytes, MROM) (MSAR2),C0H (MAMR2),7FH (B2CS),C3H ; Logical address area: C00000H to FFFFFFH ; Logical address size: 4 Mbytes ; Condition: 16 bits, 0 waits (16 Mbytes, MROM) (MSAR1),40H (MAMR1),FFH (B1CS),83H ; Logical address area: 400000H to 5FFFFFH ; Logical address size: 4 Mbytes ; Condition: 16 bits, 0 waits (16 Mbytes, SDRAM) (MSAR0),00H (MAMR0),FFH (B0CS),89H ; Logical address area: 000000H to 1FFFFFH ; Logical address size: 2 Mbytes ; Condition: 8 bits, 1 wait (8 Mbytes, SRAM)
Figure 3.8.5 Bank Operation S/W Example 1 Secondly, it shows example of initial setting at Figure 3.8.5. Because CS0 connect to RAM: 8-bit bus, 8 Mbytes, it need to set 8-bit bus. At this example, it set 1-wait setting. In the same way CS1 set to 16-bit bus and 0 waits, CS2 set 16-bit bus and 0 waits, CS3 set 16-bit bus and 3 waits. By CS/WAIT controller, each chip selection signal's memory size, don't set actual connect memory size, need to set that logical address size: fitting to each local area. Actual physical address is set by each area's BANK register setting. CSEX setting of CS/WAIT controller is except above CS0 to CS3's setting. This program example isn't used CSEX setting. Finally pin condition is set. PORT60 to 65 set to CS0 , CS1 , CS2 , CS3 , EA24, EA25 and SDRAM condition.
91C820A-136
2006-01-31
TMP91C820A
;BANK Operation ;***** CS2 ***** ORG 000000H ORG 200000H ORG 400000H ORG 600000H ORG 800000H ORG A00000H ORG C00000H ORG E00000H
; Program ROM: Start address at BANK0 of LOCAL2 ; Program ROM: Start address at BANK1 of LOCAL2 ; Program ROM: Start address at BANK2 of LOCAL2 ; Program ROM: Start address at BANK3 of LOCAL2 ; Program ROM: Start address at BANK4 of LOCAL2 ; Program ROM: Start address at BANK5 of LOCAL2 ; Program ROM: Start address at BANK6 of LOCAL2 ; Program ROM: Start address at BANK7( = COMMON2) of LOCAL2 ; Logical address E00000H to FFFFFFH ; Physical address 0E00000H to 0FFFFFFH ; LOCAL3 BANK5 set 14xxxxH ; Load data (5555H) form BANK5 (140000H: Physical address) of LOCAL3 ( CS3 ) ; LOCAL3 BANK8 set 20xxxxH ; Load data (AAAAH) form BANK8 (200000H: Physical address) of LOCAL3 ( CS3 ) ; Program ROM: End address at BANK7 ( = COMMON2) of LOCAL2
LD LDW LD LDW to ORG
(LOCAL3),85H HL,(800000H) (LOCAL3),88H BC,(800000H)
FFFFFFH
;***** CS3 ***** ORG 0000000H ORG 0400000H ORG 0800000H ORG 0C00000H ORG 1000000H ORG 1400000H dw 5555H to ORG 1800000H ORG 1C00000H ORG 2000000H dw AAAAH to ORG 2400000H ORG 2800000H ORG 2C00000H ORG 3000000H ORG 3400000H ORG 3800000H ORG 3C00000H ORG 3FFFFFFH
; Data ROM: Start address at BANK0 of LOCAL3 ; Data ROM: Start address at BANK1 of LOCAL3 ; Data ROM: Start address at BANK2 of LOCAL3 ; Data ROM: Start address at BANK3 of LOCAL3 ; Data ROM: Start address at BANK4 of LOCAL3 ; Data ROM: Start address at BANK5 of LOCAL3
; Data ROM: Start address at BANK6 of LOCAL3 ; Data ROM: Start address at BANK7 of LOCAL3 ; Data ROM: Start address at BANK8 of LOCAL3
; Data ROM: Start address at BANK9 of LOCAL3 ; Data ROM: Start address at BANK10 of LOCAL3 ; Data ROM: Start address at BANK11 of LOCAL3 ; Data ROM: Start address at BANK12 of LOCAL3 ; Data ROM: Start address at BANK13 of LOCAL3 ; Data ROM: Start address at BANK14 of LOCAL3 ; Data ROM: Start address at BANK15 of LOCAL3 ; Data ROM: End address at BANK15 of LOCAL3
Figure 3.8.6 BANK Operation S/W Example 2 Here shows example of data access between one BANK and other BANK. Figure 3.8.6 is one software example. A dot line square area shows one memory and each dot line square shows CS2 's program ROM and CS3 's data ROM. Program start from E00000H address, firstly, write to BANK register of LOCAL3 area upper 5-bit address of access point. In case of this example, because most upper address bit of physical address is EA25, most upper address bit of BANK register is meaningless. 4-bits of upper 5-bits address means 16 BANKs. After setting BANK5, accessing 800000H to BFFFFFH address: logical LOCAL3 address, actually access to physical 1400000H to 1700000H address.
91C820A-137
2006-01-31
TMP91C820A
;BANK Operation ;***** CS2 ***** ORG 000000H ORG 200000H NOP to JP E00100H ORG 400000H ORG 600000H NOP to JP E00200H ORG 800000H ORG A00000H ORG C00000H
; Program ROM: Start address at BANK0 of LOCAL2 ; Program ROM: Start address at BANK1 of LOCAL2 ; Operation at BANK1of LOCAL2 ; Jump to BANK7( = COMMON2) of LOCAL2 ; Program ROM: Start address at BANK2 of LOCAL2 ; Program ROM: Start address at BANK3 of LOCAL2 ; Operation at BANK3 of LOCAL2 ; Jump to BANK7( = COMMON2) of LOCAL2 ; Program ROM: Start address at BANK4 of LOCAL2 ; Program ROM: Start address at BANK5 of LOCAL2 ; Program ROM: Start address at BANK6 of LOCAL2 ; Program ROM: Start address at BANK7( = COMMON2) of LOCAL2 ; Logical address E00000H to FFFFFFH ; Physical address 0E00000H to 0FFFFFFH ; LOCAL2 BANK1 set 20xxxxH ; Jump to BANK1 (200000H: Physical address) of LOCAL2
!!!! Program Start !!!!
ORG E00000H
LD JP to ORG
(LOCAL2),81H C00000H
E00100H LD (LOCAL2),83H JP C00000H E00200H LD (LOCAL1),00H LD (LSARCH),60H LD (LSARCM),00H LD (LSARCL),00H SET 0,(LCTCTL) FFFFFFH
; LOCAL2 BANK3 set 60xxxxH ; Jump to BANK3 (600000H: Physical address) of LOCAL2
to ORG to
ORG
; Disable BANK ; LCD display set ; C_area start address ; C_area start address ; C_area start address ; LCD display start ; Program ROM: End address at BANK7( = COMMON2) of LOCAL2
;***** CS1 ***** ORG 000000H ORG 200000H ORG 400000H ORG 600000H dl 01234567H to ORG ORG ORG ORG ORG 800000H A00000H C00000H E00000H FFFFFFH
; SDRAM: Start address at BANK0 of LOCAL1 ; SDRAM: Start address at BANK1 of LOCAL1 ; SDRAM: Start address at BANK2 of LOCAL1 ; SDRAM: Start address at BANK3( = COMMON1) of LOCAL1 ; Display data
; SDRAM: Start address at BANK4 of LOCAL1 ; SDRAM: Start address at BANK5 of LOCAL1 ; SDRAM: Start address at BANK6 of LOCAL1 ; SDRAM: Start address at BANK7 of LOCAL1 ; SDRAM: End address at BANK7 of LOCAL1
Figure 3.8.7 Bank Operation S/W Example 3
91C820A-138
2006-01-31
TMP91C820A
At Figure 3.8.7, it shows example of program jump. In the same way with before example, two dot line squares show each CS2 's program ROM and CS1 's (SDCS) SDRAM. Program start from E00000H COMMON address, firstly, write to BANK register of LOCAL2 area upper 3-bit address of jumping point. After setting BANK1, jumping C00000H to DFFFFFH address: logical LOCAL2 address, actually jump to physical 200000H to 3FFFFFH address. When return to COMMON area, it can only jump to E00000H to FFFFFFH without writing to BANK register of LOCAL2 area. By a way of setting of BANK register, the setting that BANK address and COMMON address conflict with is possible. When two kinds or more logical addresses to show COMMON area exist, management of BANK is confused. We recommend not using The BANK setting, BANK address and COMMON address conflict with. When using LCD display data for SDRAM, we recommend setting display area to COMMON area in SDRAM. Because of, LCD displays DMA occur at sycronousless. If SDRAM BANK is changed, you don't need to care only COMMON area. It is a mark paid attention to here, it needs to go by way of COMMON area by all means when moves from a BANK to a BANK. In other words, it must write to BANK register only in COMMON area and it prohibits writing the BANK registers in BANK area. If it modify the bank register's data in BANK area, program runaway. Please do not set Bank function of MMU as display RAM. This is because reading LCDC display data is not controlled by the CPU. Therefore if BANK of display area is changed during LCD displaying, it cannot display. It is recommended to allocate display data to a COMMON area.
91C820A-139
2006-01-31
TMP91C820A
3.9
Serial Channels
TMP91C820A includes three serial I/O channels. For each channels either UART mode (Asynchronous transmission) or I/O interface mode (Synchronous transmission) can be selected. (Channel 2 can be selected only UART mode.) * I/O interface mode Mode 0: For transmitting and receiving I/O data using the synchronizing signal SCLK for extending I/O. 7-bit data 8-bit data 9-bit data
* UART mode
Mode 1: Mode 2: Mode 3:
In mode 1 and mode 2 a parity bit can be added. Mode 3 has a wakeup function for making the master controller start slave controllers via a serial link (A multi-controller system). Figure 3.9.2, 3.9.3, 3.9.4 are block diagrams for each channel. Each channel can be used independently. Each channel operates in the same fashion except for the following points, hence only the operation of channel 0 is explained below. Table 3.9.1 Differences between Channels 0 to 2 Channel 0
Pin name TXD0 (PC0) RXD0 (PC1) CTS0 /SCLK0 (PC2) Yes
Channel 1
TXD1 (PC3) RXD1 (PC4) CTS1 /SCLK1 (PC5) No
Channel 2
TXD2 (PB0) RXD2 (PB1) No
IrDA mode
This chapter contains the following sections: 3.9.1 Block Diagrams 3.9.2 Operation of Each Circuit 3.9.3 SFRs 3.9.4 Operation in Each Mode 3.9.5 Support for IrDA
91C820A-140
2006-01-31
TMP91C820A
* Mode 0 (I/O interface mode) Bit0 1 2 3 4 5 6 7
Transfer direction * Mode 1 (7-bit UART mode) Start Bit0 1 2 3 4 5 6 Stop
No parity
Parity *
Start
Bit0
1
2
3
4
5
6
Parity Stop
Mode 2 (8-bit UART mode) Start Bit0 1 2 3 4 5 6 7 Stop
No parity
Parity *
Start
Bit0
1
2
3
4
5
6
7
Parity Stop
Mode 3 (9-bit UART mode) Start Bit0 1 2 3 4 5 6 7 8 Stop
Wake up
Start
Bit0
1
2
3
4
5
6
7
Bit8
Stop
When bit8 = 1, address (Select code) is denoted. When bit8 = 0, data is denoted.
Figure 3.9.1 Data Formats
91C820A-141
2006-01-31
TMP91C820A 3.9.1 Block Diagrams
Figure 3.9.2 is a block diagram representing serial channel 0.
T0 Prescaler 2 4 8 16 32 64 T2 T8 T32 Serial clock generation circuit BR0CR BR0CR T0 T2 T8 T32 Prescaler Selector BR0ADD Selector Selector UART mode TA0TRG (from TMRA0)
SIOCLK
/2 SCLK0 Shared with PC2 I/O interface mode
Selector
fSYS
BR0CR Baud rate generator
SC0MOD0
SC0MOD0
I/O interface mode
SC0CR INT request INTRX0 INTTX0 SC0MOD0 Serial channel interrupt control Transmision counter (Only UART / 16) TXDCLK Receive control SC0CR
Parity control
SCLK0 Shared with PC2
(Only UART / 16)
Receive counter
RXDCLK SC0MOD0
Transmission control SC0MOD0
CTS0
Shared with PC2
RXD0 Shared with PC1
Receive buffer 1 (Shift register)
RB8
Receive buffer 2 (SC0BUF)
Error flag
TB8
Transmission buffer (SC0BUF)
SC0CR Internal data bus
TXD0 Shared with PC0
Figure 3.9.2 Block Diagram of the Serial Channel 0
91C820A-142
2006-01-31
TMP91C820A
T0
Prescaler 2 4 8 16 32 64 T2 T8 T32 Serial clock generation circuit BR1CR BR1CR T0 T2 T8 T32 Prescaler Selector BR1ADD Selector Selector UART mode TA0TRG (from TMRA0)
SIOCLK
/2 SCLK1 Shared with PC5 I/O interface mode
Selector
fSYS
BR1CR Baud rate generator
SC1MOD0
SC1MOD0
I/O interface mode
SC1CR INT request INTRX1 INTTX1 SC1MOD0 Serial channel interrupt control TXDCLK Receive control SC1CR
Parity control
SCLK1 Shared with PC5
(Only UART / 16)
Receive counter
Transmision counter (Only UART / 16)
RXDCLK SC1MOD0
Transmission control SC1MOD0
CTS1
Shared with PC5
RXD1 Shared with PC4
Receive buffer 1 (Shift register)
RB8
Receive buffer 2 (SC1BUF)
Error flag
TB8 Transmission buffer (SC1BUF)
SC1CR Internal data bus
TXD1 Shared with PC3
Figure 3.9.3 Block Diagram of the Serial Channel 1
91C820A-143
2006-01-31
TMP91C820A
T0
Prescaler 2 4 8 16 32 64 T2 T8 T32 Serial clock generation circuit BR2CR BR2CR T0 T2 T8 T32 Prescaler Selector BR2ADD Selector Selector UART mode TA0TRG (from TMRA0)
SIOCLK
/2
Selector
fSYS
BR2CR Baud rate generator
SC2MOD0
SC2MOD0
I/O interface mode
SC2CR INT request INTRX2 INTTX2
(Only UART / 16)
Receive counter
SC2MOD0
Serial channel interrupt control TXDCLK
(Only UART / 16)
Transmision counter
RXDCLK SC2MOD0 Receive control SC2CR
Parity control
Transmission control
RXD2 Shared with PB1
Receive buffer 1 (Shift register)
RB8
Receive buffer 2 (SC2BUF)
Error flag
TB8
Transmission buffer (SC2BUF)
SC2CR Internal data bus
TXD2 Shared with PB0
Figure 3.9.4 Block Diagram of the Serial Channel 2
91C820A-144
2006-01-31
TMP91C820A 3.9.2 Operation of Each Circuit
(1) Prescaler, prescaler clock selects There is a 6-bit prescaler for waking serial clock. The clock selected using SYSCR is divided by 4 and input to the prescaler as T0. The prescaler can be run by selecting the baud rate generator as the waking serial clock. Table 3.9.2 shows prescaler clock resolution into the baud rate generator. Table 3.9.2 Prescaler Clock Resolution to Baud Rate Generator
Select System Clock
1 (fs)
Select Prescaler Clock
XXX
Gear Value
Prescaler Output Clock Resolution T0
2 /fs 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc -
6 5 4 3 2 2
T2
2 /fs 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc
8 8 7 6 5 4 4
T8
2 /fs 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc
10 10 9 8 7 6 6
T32
2 /fs 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc 2 /fc
12 12 11 10 9 8 8
000 (fc) 00 (fFPH) 0 (fc) 001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16) 10 (fc/16 clock) XXX
X: Don't care, -: Cannot be used The baud rate generator selects between 4-clock inputs: T0, T2, T8, and T32 among the prescaler outputs.
91C820A-145
2006-01-31
TMP91C820A
(2) Baud rate generator The baud rate generator is a circuit, which generates transmission and receiving clocks that determine the transfer rate of the serial channels. The input clock to the baud rate generator, T0, T2, T8 or T32, is generated by the 6-bit prescaler which is shared by the timers. One of these input clocks is selected using the BR0CR field in the baud rate generator control register. The baud rate generator includes a frequency divider, which divides the frequency by 1 or N + (16 - K)/16 or 16 values, determining the transfer rate. The transfer rate is determined by the settings of BR0CR and BR0ADD. * In UART mode The settings BR0ADD are ignored. The baud rate generator divides the selected prescaler clock by N, which is set in BR0CK. (N = 1, 2, 3 ... 16) (2) When BR0CR = 1 The N + (16 - K)/16 division function is enabled. The baud rate generator divides the selected prescaler clock by N + (16 - K)/16 using the value of N set in BR0CR (N = 2, 3 ... 15) and the value of K set in BR0ADD. (K = 1, 2, 3 ... 15) Note: If N = 1 or N = 16, the N + (16 - K)/16 division function is disabled. Set BR0CR to 0. * In I/O interface mode The N + (16 - K)/16 division function is not available in I/O interface mode. Set BR0CR to 0 before dividing by N. The method for calculating the transfer rate when the baud rate generator is used is explained below. * In UART mode Input clock of baud rate generator Baud rate = Frequency divider for baud rate generator / 16 (1) When BR0CR = 0
*
In I/O interface mode Input clock of baud rate generator Baud rate = Frequency divider for baud rate generator
/2
91C820A-146
2006-01-31
TMP91C820A
* Integer divider (N divider) For example, when the source clock frequency (fc) = 12.288 MHz, the input clock frequency = T2 (fc/16), the frequency divider N (BR0CR) = 5, and BR0CR = 0, the baud rate in UART mode is as follows:
* Clock state System clock: Clock gear: High frequency (fc) 1 (fc)
Prescaler clock: System clock
Baud rate =
fc/16 / 16 5 = 12.288 x 106 / 16 / 5 / 16 = 9600 (bps)
Note: The N + (16 - K)/16 division function is disabled and setting BR0ADD is invalid. * N + (16 - K)/16 divider (Only UART mode) Accordingly, when the source clock frequency (fc) = 4.8 MHz, the input clock frequency = T0, the frequency divider N (BR0CR) = 7, K (BR0ADD) = 3, and BR0CR = 1, the baud rate in UART mode is as follows:
* Clock state System clock: Clock gear: High frequency (fc) 1 (fc)
Prescaler clock: System clock
Baud rate =
fc/4 / 16 7 + (16 - 3)/16
= 4.8 x 106 / 4 / (7 + 13/16) / 16 = 9600 (bps) Table 3.9.3 show examples of UART mode transfer rates. Additionally, the external clock input is available in the serial clock. (Serial channels 0, 1). The method for calculating the baud rate is explained below: * In UART mode Baud rate = external clock input frequency / 16 It is necessary to satisfy (External clock input cycle) 4/fc * In I/O interface mode Baud rate = external clock input frequency It is necessary to satisfy (External clock input cycle) 16/fc
91C820A-147
2006-01-31
TMP91C820A
Table 3.9.3 Transfer Rate Selection (When baud rate generator is used and BR0CR = 0) Input Clock fc [MHz]
9.830400 12.288000 14.745600 19.6608 22.1184 24.576 27.0336 29.4912 31.9488 34.4064
Frequency Divider N (BR0CR)
2 4 8 0 5 A 2 3 6 C 1 2 4 8 10 3 1 2 4 5 8 A 10 B 1 3 4 6 9 C F 10 D 7
T0
76.800 38.400 19.200 9.600 38.400 19.200 115.200 76.800 38.400 19.200 307.200 153.600 76.800 38.400 19.200 115.200 384.000 192.000 96.000 76.800 48.000 38.400 24.000 38.400 460.800 153.600 115.200 76.800 51.200 38.400 30.720 28.800 38.400 76.800
T2
19.200 9.600 4.800 2.400 9.600 4.800 28.800 19.200 9.600 4.800 76.800 38.400 19.10 9.600 4.800 28.800 96.000 48.000 24.000 19.200 12.000 9.600 6.000 9.600 115.200 38.400 28.800 19.200 12.800 9.600 7.680 7.200 9.600 19.200
T8
4.800 2.400 1.200 0.600 2.400 1.200 7.200 4.800 2.400 1.200 19.200 93.600 4.800 2.400 1.200 7.200 24.000 12.000 6.000 4.800 3.000 2.400 1.500 2.400 28.800 9.600 7.200 4.800 3.200 2.400 1.920 1.800 2.400 4.800
T32
1.200 0.600 0.300 0.150 0.600 0.300 1.800 1.200 0.600 0.300 4.800 2.400 1.200 0.600 0.300 1.800 6.000 3.000 1.500 1.200 0.750 0.600 0.375 0.600 7.200 2.400 1.800 1.200 1.800 1.600 1.480 0.450 0.600 1.200
Note 1: Transfer rates in I/O interface mode are eight times faster than the values given above. Note 2: The values in this table are calculated for when fc is selected as the system clock, the clock gear is set for fc and the system clock is the prescaler clock input. Timer out clock (TA0TRG) can be used for source clock of UART mode only. Calculation method the frequency of TA0TRG Frequency of TA0TRG = Baud rate x 16
Note:
The TMRA0 match detect signal cannot be used as the transfer clock in I/O interface mode.
91C820A-148
2006-01-31
TMP91C820A
(3) Serial clock generation circuit This circuit generates the basic clock for transmitting and receiving data. * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the basic clock is generated by dividing the output of the baud rate generator by 2, as described previously. In SCLK input mode with the setting SC0CR = 1, the rising edge or falling edge will be detected according to the setting of the SC0CR register to generate the basic clock. * In UART mode The SC0MOD0 setting determines whether the baud rate generator clock, the internal system clock fSYS, the match detect signal from timer TMRA0 or the external clock (SCLK0) is used to generate the basic clock SIOCLK. (4) Receiving counter The receiving counter is a 4-bit binary counter used in UART mode, which counts up the pulses of the SIOCLK clock. It takes 16 SIOCLK pulses to receive 1 bit of data; each data bit is sampled three times - on the 7th, 8th and 9th clock cycles. The value of the data bit is determined from these three samples using the majority rule. For example, if the data bit is sampled respectively as 1, 0 and 1 on 7th, 8th and 9th clock cycles, the received data bit is taken to be 1. A data bit sampled as 0, 0 and 1 is taken to be 0. (5) Receiving control * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the RXD0 signal is sampled on the rising or falling edge of the shift clock which is output on the SCLK0 pin, according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the RXD0 signal is sampled on the rising or falling edge of the SCLK0 input, according to the SC0CR setting. * In UART mode The receiving control block has a circuit, which detects a start bit using the majority rule. Received bits are sampled three times; when two or more out of three samples are 0, the bit is recognized as the start bit and the receiving operation commences. The values of the data bits that are received are also determined using the majority rule.
91C820A-149
2006-01-31
TMP91C820A
(6) The receiving buffers To prevent overrun errors, the receiving buffers are arranged in a double-buffer structure. Received data is stored one bit at a time in receiving buffer 1 (which is a shift register). When 7 bits or 8 bits of data have been stored in receiving buffer 1, the stored data is transferred to receiving buffer 2 (SC0BUF); this causes an INTRX0 interrupt to be generated. The CPU only reads receiving buffer 2 (SC0BUF). Even before the CPU reads receiving buffer 2 (SC0BUF), the received data can be stored in receiving buffer 1. However, unless receiving buffer 2 (SC0BUF) is read before all bits of the next data are received by receiving buffer 1, an overrun error occurs. If an overrun error occurs, the contents of receiving buffer 1 will be lost, although the contents of receiving buffer 2 and SC0CR will be preserved. SC0CR is used to store either the parity bit - added in 8-bit UART mode - or the most significant bit (MSB) - in 9-bit UART mode. In 9-bit UART mode the wakeup function for the slave controller is enabled by setting SC0MOD0 to 1; in this mode INTRX0 interrupts occur only when the value of SC0CR is 1. (7) Transmission counter The transmission counter is a 4-bit binary counter which is used in UART mode and which, like the receiving counter, counts the SIOCLK clock pulses; a TXDCLK pulse is generated every 16 SIOCLK clock pulses.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Figure 3.9.5 Generation of the Transmission Clock (8) Transmission control * In I/O interface mode In SCLK output mode with the setting SC0CR = 0, the data in the transmission buffer is output one bit at a time to the TXD0 pin on the rising or falling edge of the shift clock which is output on the SCLK0 pin, according to the SC0CR setting. In SCLK input mode with the setting SC0CR = 1, the data in the transmission buffer is output one bit at a time on the TXD0 pin on the rising or falling edge of the SCLK0 input, according to the SC0CR setting. * In UART mode When transmission data sent from the CPU is written to the transmission buffer, transmission starts on the rising edge of the next TXDCLK, generating a transmission shift clock TXDSFT.
91C820A-150
2006-01-31
TMP91C820A
Handshake function Use of CTS pin allows data can be sent in units of one frame; thus, overrun errors can be avoided. The handshake functions is enabled or disabled by the SC0MOD setting. When the CTS0 pin goes high on completion of the current data send, data transmission is halted until the CTS0 pin goes low again. However, the INTTX0 interrupt is generated, it requests the next data send to the CPU. The next data is written in the transmission buffer and data sending is halted. Though there is no RTS pin, a handshake function can be easily configured by setting any port assigned to be the RTS function. The RTS should be output high to request send data halt after data receive is completed by software in the RXD interrupt routine.
TMP91C820A TMP91C820A
TXD
CTS
RXD
RTS (Any port)
Sender
Receiver
Figure 3.9.6 Handshake Function
Timing to writing to the transmission buffer
Send is suspended from (a) and (b).
CTS
(a) SIOCLK
13
(b) 14 15
16
1
2
3
14
15
16
1
2
3
TXDCLK Bit0
TXD
Note 1:
Start bit
If the CTS signal goes high during transmission, no more data will be sent after completion of the current transmission.
Note 2:
Transmission starts on the first falling edge of the TXDCLK clock after the CTS signal has fallen.
Figure 3.9.7 CTS (Clear to send) Timing
91C820A-151
2006-01-31
TMP91C820A
(9) Transmission buffer The transmission buffer (SC0BUF) shifts out and sends the transmission data written from the CPU form the least significant bit (LSB) in order. When all the bits are shifted out, the transmission buffer becomes empty and generates an INTTX0 interrupt. (10) Parity control circuit When SC0CR in the serial channel control register is set to 1, it is possible to transmit and receive data with parity. However, parity can be added only in 7-bit UART mode or 8-bit UART mode. The SC0CR field in the serial channel control register allows either even or odd parity to be selected. In the case of transmission, parity is automatically generated when data is written to the transmission buffer SC0BUF. The data is transmitted after the parity bit has been stored in SC0BUF in 7-bit UART mode or in SC0MOD0 in 8-bit UART mode. SC0CR and SC0CR must be set before the transmission data is written to the transmission buffer. In the case of receiving, data is shifted into receiving buffer 1, and the parity is added after the data has been transferred to receiving buffer 2 (SC0BUF), and then compared with SC0BUF in 7-bit UART mode or with SC0CR in 8-bit UART mode. If they are not equal, a parity error is generated and the SC0CR flag is set. (11) Error flags Three error flags are provided to increase the reliability of data reception. 1. Overrun error If all the bits of the next data item have been received in receiving buffer 1 while valid data still remains stored in receiving buffer 2 (SC0BUF), an overrun error is generated. (INTRX interrupt routine) 1) Read receiving buffer 2) Read error flag 3) If = 1 then a) Set to disable receiving (Write 0 to SC0MOD0) b) Wait to terminate current frame c) Read receiving buffer d) Read error flag e) Set to enable receiving (Write 1 to SC0MOD0) f) Request to transmit again 4) Other 2. Parity error The parity generated for the data shifted into receiving buffer 2 (SC0BUF) is compared with the parity bit received via the RXD pin. If they are not equal, a parity error is generated. 3. Framing error The stop bit for the received data is sampled three times around the center. If the majority of the samples are 0, a framing error is generated.
91C820A-152
2006-01-31
TMP91C820A
(12) Timing generation a. In UART mode Receiving Mode
Interrupt timing Framing error timing Parity error timing Overrun error timing
9 Bits (Note)
Center of last bit (Bit8) Center of stop bit - Center of last bit (Bit8)
8 Bits + Parity (Note)
Center of last bit (Parity bit) Center of stop bit Center of last bit (Parity bit) Center of last bit (Parity bit)
8 Bits, 7 Bits + Parity, 7 Bits
Center of stop bit Center of stop bit Center of stop bit Center of stop bit
Note:
In 9 bits and 8 bits + parity modes, interrupts coincide with the ninth bit pulse. Thus, when servicing the interrupt, it is necessary to wait for a 1-bit period (to allow the stop bit to be transferred) to allow checking for a framing error.
Transmitting Mode
Interrupt timing
9 Bits
Just before stop bit is transmitted
8 Bits + Parity
Just before stop bit is transmitted
8 Bits, 7 Bits + Parity, 7 Bits
Just before stop bit is transmitted
b. I/O interface
Transmission interrupt timing Receiving interrupt timing SCLK output mode SCLK input mode SCLK output mode SCLK input mode Immediately after last bit data. (See figure 3.9.25) Immediately after rise of last SCLK signal rising mode, or immediately after fall in falling mode. (See figure 3.9.26) Timing used to transfer received to data receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK). (See figure 3.9.27) Timing used to transfer received data to receive buffer 2 (SC0BUF) (e.g., immediately after last SCLK). (See figure 3.9.28)
91C820A-153
2006-01-31
TMP91C820A 3.9.3 SFRs
7
Bit symbol TB8 SC0MOD0 Read/Write (0202H) After reset 0 Function Transfer data bit8
6
CTSE 0 Handshake
0: CTS disable 1: CTS enable
5
RXE 0 Receive function
0: Receive disable 1: Receive enable
4
WU
3
SM1
2
SM0
1
SC1
0
SC0
R/W 0 0 0 Wakeup Serial transmission function mode 00: I/O interface mode 0: Disable 01: 7-bit UART mode 1: Enable 10: 8-bit UART mode 11: 9-bit UART mode
0 0 Serial transmission clock (UART) 00: TMRA0 trigger 01: Baud rate generator 10: Internal clock fSYS 11: External clcok (SCLK0 input)
Serial transmission clock source (UART) 00 01 10 11 Timer TMRA0 match detect signal Baud rate generator Internal clock fSYS External clock (SCLK0 input)
Note: The clock selection for the I/O interface mode is controlled by the serial bontrol register (SC0CR). Serial transmission mode 00 01 10 11 I/O interface mode 7-bit mode UART mode 8-bit mode 9-bit mode
Wakeup function 9-bit UART Other modes Interrupt generated when 0 data is received Don't care Interrupt generated only 1 when SC0CR = 1 Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 1 Disabled (Always transferable) Enabled
Transmission data bit8
Figure 3.9.8 Serial Mode Control Register (Channel 0, SC0MOD0)
91C820A-154
2006-01-31
TMP91C820A
7
Bit symbol TB8 SC1MOD0 Read/Write (020AH) After reset 0 Function Transfer data bit8
6
CTSE 0 Handshake
0: CTS disable 1: CTS enable
5
RXE 0 Receive function
0: Receive disable 1: Receive enable
4
WU
3
SM1
2
SM0
1
SC1
0
SC0
R/W 0 0 0 Wakeup Serial transmission function mode 00: I/O interface mode 0: Disable 01: 7-bit UART mode 1: Enable 10: 8-bit UART mode 11: 9-bit UART mode
0 0 Serial transmission clock (UART) 00: TMRA0 trigger 01: Baud rate generator 10: Internal clock fSYS 11: External clcok (SCLK1 input)
Serial transmission clock source (for UART) 00 01 10 11 00 01 10 11 Timer TMRA0 match detect signal Baud rate generator Internal clock fSYS External clock (SCLK1 input) I/O interface mode 7-bit mode UART mode 8-bit mode 9-bit mode
Serial transmission mode
Wakeup function 9-bit UART Other modes Interrupt generated when 0 data is received Don't care Interrupt generated only 1 when SC1CR = 1 Receiving function 0 1 Receive disabled Receive enabled
Handshake function ( CTS pin) 0 1 Disabled (Always transferable) Enabled
Transmission data bit8
Figure 3.9.9 Serial Mode Control Register (Channel 1, SC1MOD0)
91C820A-155
2006-01-31
TMP91C820A
7
Bit symbol TB8 SC2MOD0 Read/Write (0212H) After reset 0 Function Transfer data bit8
6
- 0 Always write "0".
5
RXE 0 Receive function 0: Receive disable 1: Receive enable
4
WU R/W 0 Wakeup function 0: Disable 1: Enable
3
SM1 0
00: Reserved
2
SM0 0
1
SC1 0
(UART) 00: TMRA0 trigger
0
SC0 0
Serial transmission mode 01: 7-bit UART mode 10: 8-bit UART mode 11: 9-bit UART mode
Serial transmission clock
01: Baud rate generator 10: Internal clock fSYS 11: Reserved
Serial transmission clock source (for UART) 00 01 10 11 00 01 10 11 Timer TMRA0 match detect signal Baud rate generator Internal clock fSYS Reserved Reserved UART mode 7-bit mode 8-bit mode 9-bit mode
Serial transmission mode
Wakeup function 9-bit UART Other modes Interrupt generated when 0 data is received Don't care Interrupt generated only 1 whenSC2CR = 1 Receiving function 0 1 Receive disabled Receive enabled
Transmission data bit8
Figure 3.9.10 Serial Mode Control Register (Channel 2, SC2MOD0)
91C820A-156
2006-01-31
TMP91C820A
7
SC0CR (0201H)
6
5
4
3
2
1
0
Bit symbol RB8 EVEN PE Read/Write R R/W After reset Undefined 0 0 Function Received Parity Parity data bit8 0: Odd addition 1: Even 0: Disable 1: Enable
OERR PERR FERR R (Cleared to 0 when read) 0 0 0 1: Error
SCLKS IOC R/W 0 0 0: SCLK0 0: Baud rate
generator 1: SCLK0 pin input
Overrun
Parity
Framing
1: SCLK0
I/O interface input clock selection 0 1 Baud rate generator SCLK0 pin input
Edge selection for SCLK pin (Input/output mode) 0 1 Transmits and receivers data on rising edge of SCLK0. Transmits and receivers data on falling edge SCLK0.
Framing error flag Parity error flag Overrun error flag Parity addition enable 0 1 Disabled Enabled
Cleared to "0" when read
Even parity addition/check 0 1 Odd parity Even parity
Received data bit8
Note:
As all error flags are cleared after reading, do not test only a single bit with a bit testing instruction.
Figure 3.9.11 Serial Control Register (Channel 0, SC0CR)
91C820A-157
2006-01-31
TMP91C820A
7
SC1CR (0209H) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
0
RB8 EVEN PE R R/W Undefined 0 0 Parity Parity Received addition 0: Odd data bit8 0: Disable 1: Even 1: Enable
OERR PERR FERR R (Cleared to 0 when) 0 0 0 1: Error
SCLKS IOC R/W 0 0 0: SCLK1 0: Baud rate
generator 1: SCLK1 pin input
Overrun
Parity
Framing
1: SCLK1
I/O interface input clock select 0 1 Baud rate generator SCLK1 pin input
Edge selection for SCLK pin (Input/output mode) 0 1 Transmits and receives data on rising edge of SCLK1. Transmits and receives data on falling edge of SCLK1.
Framing error flag Parity error flag Overrun error flag Parity addition enable 0 1 Disabled Enabled
Cleared to "0" when read
Even parity addition/check 0 1 Odd parity Even parity
Received data bit8
Note:
As all error flags are cleared after reading, do not test only a single bit with a bit testing instruction.
Figure 3.9.12 Serial Control Register (Channel 1, SC1CR)
91C820A-158
2006-01-31
TMP91C820A
7
SC2CR (0211H) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
- R/W 0 Always write "0".
0
- 0 Always write "0".
RB8 EVEN PE R R/W Undefined 0 0 Received Parity Parity data bit8 0: Odd addition 1: Even 0: Disable 1: Enable
OERR PERR FERR R (Cleared to 0 when) 0 0 0 1: Error
Overrun
Parity
Framing
Framing error flag Parity error flag Overrun error flag Parity addition enable 0 1 Disabled Enabled
Cleared to "0" when read
Even parity addition/check 0 1 Odd parity Even parity
Received data bit8
Note:
As all error flags are cleared after reading, do not test only a single bit with a bit testing instruction.
Figure 3.9.13 Serial Control Register (Channel 2, SC2CR)
91C820A-159
2006-01-31
TMP91C820A
7
BR0CR (0203H) Bit symbol Read/Write After reset Function 0 Always write "0". -
6
BR0ADDE 0
5
BR0CK1 0
4
BR0CK0 R/W 0
3
BR0S3 0
2
BR0S2 0
1
BR0S1 0
0
BR0S0 0
+ (16 - K)/16 00: T0 division 01: T2 0: Disable 10: T8 1: Enable 11: T32
Setting of the divided frequency "N" (0 to F)
+ (16 - K)/16 division enable 0 1 Disable Enable
Setting the input clock of baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
7
BR0ADD Bit symbol (0204H) Read/Write After reset Function
6
5
4
3
BR0K3 0
2
BR0K2 R/W 0
1
BR0K1 0
0
BR0K0 0
Sets frequency divisor "K" (Divided by N + (16 - K)/16)
Sets baud rate generator frequency divisor BR0CR = 1 BR0CR 0000 (N = 16) 0010 (N = 2) or to 0001 (N = 1) 1111 (N = 15) Disable Disable Disable Divided by N + (16 - K)/16 Divided by N BR0CR = 0 0001 (N = 1) (Only UART) to 1111 (N = 15) 0000 (N = 16)
BR0ADD
0000 0001 (K = 1) to 1111 (K = 15)
Note1:Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode x I/O mode x x
The baud rate generator can be set "1" in UART mode and disable +(16-K)/16 division function.Don't use in I/O interface mode. Note2:Set BR0CR to 1 after setting K (K = 1 to 15) to BR0ADD when +(16-K)/16 division function is used. Writes to unused bits in the BR0ADD register do not affext operation, and undefined data is read from these unused bits.
Figure 3.9.14 Baud Rate Generator Control (Channel 0, BR0CR, BR0ADD)
91C820A-160
2006-01-31
TMP91C820A
7
Bit symbol BR1CR Read/Write (020BH) After reset Function - 0 Always write "0".
6
BR1ADDE 0 division 0: Disable 1: Enable
5
BR1CK1 0 01: T2 10: T8 11: T32
4
BR1CK0 R/W 0
3
BR1S3 0
2
BR1S2 0
1
BR1S1 0
0
BR1S0 0
+ (16 - K)/16 00: T0
Setting of the divided frequency "N" (0 to F)
+ (16 - K)/16 division enable 0 1 Disabled Enabled
Input clock selection for baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
7
BR1ADD Bit symbol (020CH) Read/Write After reset Function
6
5
4
3
BR1K3 0
2
BR1K2 R/W 0
1
BR1K1 0
0
BR1K0 0
Sets frequency divisor "K" (Divided by N + (16 - K)/16)
Baud rate generator frequency divisor setting BR1CR = 1 BR1CR BR1ADD 0000 0001 (K = 1) to 1111 (K = 15) 0000(N = 16) or 0001(N = 1) Disable Disable 0010 (N = 2) to 1111 (N = 15) Disable Disabled by N + (16 - K)/16 Divided by N BR1CR = 0 0001(N = 1) (Only UART) to 1111 (N = 15) 0000 (N = 16)
Note1:Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode x I/O mode x x
The baud rate generator can be set "1" in UART mode and disable +(16-K)/16 division function. Don't use in I/O interface mode. Note2:Set BR1CR to 1 after setting K (K = 1 to 15) to BR1ADD when +(16-K)/16 division function is used. Writes to unused bits in the BR1ADD register do not affext operation, and undefined data is read from these unused bits.
Figure 3.9.15 Baud Rate Generator Control (Channel 1, BR1CR, BR1ADD)
91C820A-161
2006-01-31
TMP91C820A
7
BR2CR (0213H) Bit symbol Read/Write After reset Function 0 Always write "0". 0 division 0: Disable 1: Enable 0 01: T2 10: T8 11: T32 0
+ (16 - K)/16 00: T0
6
BR2ADDE
5
BR2CK1
4
BR2CK0 R/W
3
BR2S3 0
2
BR2S2 0
1
BR2S1 0
0
BR2S0 0
-
Setting of the divided frequency "N" (0 to F)
+ (16 - K)/16 division enable 0 1 Disabled Enabled
Input clock selection for baud rate generator 00 01 10 11 Internal clock T0 Internal clock T2 Internal clock T8 Internal clock T32
7
Bit symbol BR2ADD Read/Write (0214H) After reset Function
6
5
4
3
BR2K3 0
2
BR2K2 R/W 0
1
BR2K1 0
0
BR2K0 0
Sets frequency divisor "K" (Divided by N + (16 - K)/16)
Baud rate generator frequency divisor setting BR2CR = 1 BR2CR BR2ADD 0000 0001 (K = 1) to 1111 (K = 15) 0000 (N = 16) or 0001 (N = 1) Disable Disable 0010 (N = 2) to 1111 (N = 15) Disable Disabled by N + (16 - K)/16 Divided by N BR2CR = 0 0001 (N = 1) (Only UART) to 1111 (N = 15) 0000 (N = 16)
Note1:Availability of +(16-K)/16 division function N 2 to 15 1 , 16 UART mode x I/O mode x x
The baud rate generator can be set "1" in UART mode and disable +(16-K)/16 division function. Don't use in I/O interface mode. Note2:Set BR2CR to 1 after setting K (K = 1 to 15) to BR2ADD when +(16-K)/16 division function is used. Writes to unused bits in the BR2ADD register do not affext operation, and undefined data is read from these unused bits
Figure 3.9.16 Baud Rate Generator Control (Channel 2, BR2CR, BR2ADD)
91C820A-162
2006-01-31
TMP91C820A
7 TB7 SC0BUF (0200H)
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (Transmission)
7 RB7
Note:
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (Reveiving)
Prohibit read-modify-write for SC0BUF.
Figure 3.9.17 Serial Transmission/Receiving Buffer Registers (Channel 0, SC0BUF) 7
SC0MOD1 (0205H) Bit symbol Read/Write After reset Function I2S0 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX0 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.18 Serial Mode Control Register 1 (Channel 0, SC0MOD1)
7 TB7 SC1BUF (0208H)
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (Transmission)
7 RB7
Note:
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (Receiving)
Prohibit read-modify-write for SC1BUF.
Figure 3.9.19 Serial Transmission/Receiving Buffer Registers (Channel 1, SC1BUF) 7
SC1MOD1 (020DH) Bit symbol Read/Write After reset Function I2S1 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX1 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.20 Serial Mode Control Register 1 (Channel 1, SC1MOD1)
91C820A-163
2006-01-31
TMP91C820A
7 TB7 SC2BUF (0210H)
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (Transmission)
7 RB7
Note:
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (Receiving)
Prohibit read-modify-write for SC2BUF.
Figure 3.9.21 Serial Transmission/Receiving Buffer Registers (Channel 2, SC2BUF) 7
SC2MOD1 (0215H) Bit symbol Read/Write After reset Function I2S2 R/W 0 IDLE2 0: Stop 1: Run
6
FDPX2 R/W 0 Duplex 0: Half 1: Full
5
4
3
2
1
0
Figure 3.9.22 Serial Mode Control Register 1 (Channel 2, SC2MOD1)
91C820A-164
2006-01-31
TMP91C820A 3.9.4 Operation in Each Mode
(1) Mode 0 (I/O interface mode) This mode allows an increase in the number of I/O pins available for transmitting data to or receiving data from an external shift register. This mode includes the SCLK output mode to output synchronous clock SCLK and SCLK input mode to input external synchronous clock SCLK.
Output extension TMP91C820A TXD SCLK Port Shift register SI SCK RCK A B C D E F G H TC74HC595 or equivalent Port S/ L SCLK CLOCK RXD QH Input extension TMP91C820A Shift register A B C D E F G H TC74HC165 or equivalent
Figure 3.9.23 SCLK Output Mode Connection Example
Output extension TMP91C820A TXD SCLK Port Shift register SI SCK RCK A B C D E F G H TC74HC595 or equivalent External clock External clock Port S/ L SCLK CLOCK RXD QH Input extension TMP91C820A Shift register A B C D E F G H TC74HC165 or equivalent
Figure 3.9.24 Example of SCLK Input Mode Connection
91C820A-165
2006-01-31
TMP91C820A
a. Transmission In SCLK output mode 8-bit data and a synchronous clock are output on the TXD0 and SCLK0 pins respectively each time the CPU writes the data to the transmission buffer. When all data is output, INTES0 will be set to generate the INTTX0 interrupt.
Timing to write transmission data SCLK1 output (=0 Rising edge mode) SCLK1 output (=1 Falling edge mode) TXD1 ITX1C (INTTX1 Interrupt request) Bit0 Bit1 Bit6 Bit7
(Internal clock timing)
Figure 3.9.25 Transmitting Operation in I/O Interface Mode (SCLK0 output mode) (Channel 0)
In SCLK input mode, 8-bit data is output on the TXD0 pin when the SCLK0 input becomes active after the data has been written to the transmission buffer by the CPU. When all data is output, INTES0 will be set to generate INTTX0 interrupt.
SCLK1input ( = 0 Rising edge mode) SCLK1 input ( = 1 Falling edge mode) TXD1 ITX1C (INTTX1 Interrupt request) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.26 Transmitting Operation in I/O Interface Mode (SCLK0 input mode) (Channel 0)
91C820A-166
2006-01-31
TMP91C820A
b. Receiving In SCLK output mode, the synchronous clock is outputted from SCLK0 pin and the data is shifted to receiving buffer 1. This starts when the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data are received, the data will be transferred to receiving buffer 2 (SC0BUF according to the timing shown below) and INTES0 will be set to generate INTRX0 interrupt. The outputting for the first SCLK0 starts by setting SC0MOD0 to 1.
IRX1C (INTRX1 interrupt request) SCLK1 output (=0 Rising edge mode) SCLK1 output (=1 Fallingf edge mode) RXD1 Bit0 Bit1 Bit6 Bit7
Figure 3.9.27 Receiving Operation in I/O Interface Mode (SCLK0 output mode) (Channel 0)
In SCLK input mode, the data is shifted to receiving buffer 1 when the SCLK input becomes active after the receive interrupt flag INTES0 is cleared by reading the received data. When 8-bit data is received, the data will be shifted to receiving buffer 2 (SC0BUF according to the timing shown below) and INTES0 will be set again to be generate INTRX0 interrupt.
SCLK1 input ( = 0: Rising edge mode) SCLK1 input ( = 1: Falling edge mode) RXD1 IRX1C (INTRX1 ) Bit0 Bit1 Bit5 Bit6 Bit7
Figure 3.9.28 Receiving Operation in I/O Interface Mode (SCLK0 input mode) (Channel 0) Note: The system must be put in the receive enable state (SCMOD0 = 1) before data can be received.
91C820A-167
2006-01-31
TMP91C820A
c. Transmission and receiving (Full duplex mode) When the full duplex mode is used, set the level of receive interrupt to 0 and set enable the level of transmit interrupt. In the transmit interrupt program, read the receiving buffer before setting the next transmit data. The example is following. Example: Channel 0, SCLK output Baud rate = 9600 bps fc = 14.7456 MHz
System clock: Clock gear: High frequency (fc) 1 (fc)
* Clock state
Prescaler clock: fFPH Main routine 7 INTES0 PCCR PCFC SC0MOD0 SC0MOD1 SC0CR BR0CR SC0MOD0 SC0BUF Acc SC0BUF SC0BUF * * * * * * * * 0 - - 0 1 0 0 0 * 6 0 - - 0 1 0 0 0 * 5 0 - - 0 0 0 1 1 * 4 1 - - 0 0 0 1 0 * 3 0 - - 0 0 0 0 0 * 2 0 1 1 0 0 0 0 0 * 1 0 0 - 0 0 0 1 0 * 0 0 1 1 0 0 0 1 0 * Select I/O interface mode. Select full duplex mode. SCLK output, transmit on negative edge, receive on positive edge. Baud rate = 9600 bps. Enable receiving. Set the transmit data and start. Read the receiving buffer. Set the next transmit data. Set the INTTX0 level to 1. Set the INTRX0 level to 0. Set PC0, PC1 and PC2 to function as the TXD0, RXD0 and SCLK0 pins respectively.
INTTX0 interrupt routine
X: Don't care, -: No change
91C820A-168
2006-01-31
TMP91C820A
(2) Mode 1 (7-bit UART mode) 7-bit UART mode is selected by setting the serial channel mode register SC0MOD0 field to 01. In this mode a parity bit can be added. Use of a parity bit is enabled or disabled by the setting of the serial channel control register SC0CR bit; whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled). Example: When transmitting data of the following format, the control registers should be set as described below. This explanation applies to channel 0.
Even parity Stop
Start
Bit0
1
2
3
4
5
6
Transmission direction (Transmission rate: 2400 bps at fc = 12.288 MHz)
* Clock state
System clock: High frequency (fc) Clock gear: 1 (fc) Prescaler clock: System clock 4 - - X X 0 0 * 3 - - 0 X 0 - * 2 - - 1 X 1 - * 1 - - 0 0 0 - * 0 1 1 1 0 1 - *
PCCR PCFC SC0MOD SC0CR BR0CR INTES0 SC0BUF

7 - - X X 0 1 *
6 - - 0 1 0 1 *
5 - - - 1 1 0 *
Set PC0 to function as the TXD0 pin. Select 7-bit UART mode. Add even parity. Set the transfer rate to 2400 bps. Enable the INTTX0 interrupt and set it to interrupt level 4. Set data for transmission.
X: Don't care, -: No change
(3) Mode 2 (8-bit UART mode) 8-bit UART mode is selected by setting SC0MOD0 to 10. In this mode a parity bit can be added (Use of a parity bit is enabled or disabled by the setting of SC0CR); whether even parity or odd parity will be used is determined by the SC0CR setting when SC0CR is set to 1 (Enabled). Example: When receiving data of the following format, the control registers should be set as described below.
Start Bit0 1 2 3 4 5 6 7 Odd parity Stop
Transmission direction (Transmission rate: 9600 bps at fc = 12.288 MHz)
91C820A-169
2006-01-31
TMP91C820A
* Clock state
System clock: High frequency (fc) Clock gear: 1 (fc) Prescaler clock: System clock
Main settings 76543210 PCCR - - - - - - 0 - SC0MOD - 0 1 X1 0 0 1 SC0CR X0 1 XXX0 0 BR0CR 0 0 0 1 0 1 0 1 INTES0 - - - - 1 1 0 0 Interrupt processing Acc SC0CR AND 00011100 if Acc 0 then ERROR Acc SC0BUF X: Don't care, -: No change Set PC1 to function as the RXD0 pin. Enable receiving in 8-bit UART mode. Add even parity. Set the transfer rate to 9600 bps. Enable the INTRX0 interrupt and set it to interrupt level 4.
Check for errors. Read the received data.
(4) Mode 3 (9-bit UART mode) 9-bit UART mode is selected by setting SC0MOD0 to 11. In this mode parity bit cannot be added. In the case of transmission the MSB (9th bit) is written to SC0MOD0. In the case of receiving it is stored in SC0CR. When the buffer is written and read, the MSB is read or written first, before the rest of the SC0BUF data. Wakeup function In 9-bit UART mode, the wakeup function for slave controllers is enabled by setting SC0MOD0 to 1. The interrupt INTRX0 occurs only when = 1.
TXD
RXD
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1
Slave 2
Slave 3
Note: The TXD pin of each slave controller must be in open-drain output mode.
Figure 3.9.29 Serial Link Using Wakeup Function
91C820A-170
2006-01-31
TMP91C820A
Protocol
a. b. c. Select 9-bit UART mode on the master and slave controllers. Set the SC0MOD0 bit on each slave controller to 1 to enable data receiving. The master controller transmits one-frame data including the 8-bit select code for the slave controllers. The MSB (Bit8) is set to 1.
Start
Bit0
1
2
3
4
5
6
7
8 1
Stop
Select code of slave controller
d.
Each slave controller receives the above frame. Each controller checks the above select code against its own select code. The controller whose code matches clears its WU bit to 0. The master controller transmits data to the specified slave controller whose SC0MOD bit is cleared to 0. The MSB (Bit8) is cleared to 0.
e.
Start
Bit0
1
2
3 Data
4
5
6
7
Bit8 0
Stop
f.
The other slave controllers (Whose bits remain at 1) ignore the received data because their MSB (Bit8 or ) are set to 0, disabling INTRX0 interrupts. The slave controller (WU bit = 0) can transmit data to the master controller, and it is possible to indicate the end of data receiving to the master controller by this transmission.
91C820A-171
2006-01-31
TMP91C820A
Example: To link two slave controllers serially with the master controller using the internal clock fSYS as the transfer clock.
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1 Select code 00000001
Slave 2 Select code 00001010
Since Serial Channels 0 and 1 operate in exactly the same way, channel 0 only is used for the purposes of this explanation. * Setting the master controller
Main PCCR PCFC INTES0 SC0MOD0 SC0BUF
- - - - - - 0 1 - - - - - - X1 1 1 0 0 1 1 0 1 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 1
Set PC0 and PC1 to function as the TXD0 and RXD0 pins respectively. Enable the INTTX0 interrupt and set it to interrupt level 4. Enable the INTRX0 interrupt and set it to interrupt level 5. Set fSYS as the transmission clock for 9-bit UART mode. Set the select code for slave controller 1. Set TB8 to 0. Set data for transmission.
INTTX0 interrupt SC0MOD0 0 - - - - - - - * * * * * * * * SC0BUF
*
Setting the slave controller
Main PCCR PCFC PCODE INTES0 SC0MOD0

- - X 1 0
- - X 1 0
- - X 0 1
- - X 1 1
- - - 1 1
- - X 1 1
0 X X 1 1
1 1 1 0 0
Select PC1 and PC0 to function as the RXD0 and TXD0 pins respectively (Open-drain output). Enable INTRX0 and INTTX0. Set to 1 in 9-bit UART transmission mode using fSYS as the transfer clock.
INTRX0 interrupt Acc SC0BUF if Acc = select code Then SC0MOD0 - - - 0 - - - - Clear to 0.
91C820A-172
2006-01-31
TMP91C820A 3.9.5 Support for IrDA
SIO0 includes support for the IrDA 1.0 infrared data communication specification. Figure 3.9.30 shows the block diagram.
Transmisison data
IR modulator
TXD0
IR transmitter and LED
IR output
SIO0 Receive data
Modem RXD0
IR demodulator
IR receiver
IR input
TMP91C820A
Figure 3.9.30 Block Diagram
(1) Modulation of the transmission data When the transmit data is 0, the modem outputs 1 to TXD0 pin with either 3/16 or 1/16 times for width of baud rate. The pulse width is selected by the SIRCR. When the transmit data is 1, the modem outputs 0.
Transmission data Start 0 1 0 0 1 1 0 0 Stop
TXD0 pin
Figure 3.9.31 Transmission Example
(2) Demodulation of the receive data When the receive data is the effective width of pulse 1, the modem outputs 0 to SIO0. Otherwise the modem outputs 1 to SIO0. The effective pulse width is selected by SIRCR.
Receive pulse = "0"
Receive pulse = "1"
Demodulated data
Start
1
0
0
1
0
1
1
0
Stop
Figure 3.9.32 Receiving Example
(3) Data format The data format is fixed as follows: * * * Data length: 8 bits Parity bits: none Stop bits: 1
91C820A-173
2006-01-31
TMP91C820A
(4) SFR Figure 3.9.33 shows the control register SIRCR. Set the data SIRCR during SIO0 is stopping. The following example describes how to set this register: 1) SIO setting ; Set the SIO to UART mode. 2) LD (SIRCR), 07H ; Set the receive data pulse width to 16x. 3) LD (SIRCR), 37H ; TXEN, RXEN enable the transmission and receiving. 4) Start transmission ; The modem operates as follows: and receiving for SIO0 * SIO0 starts transmitting. * IR receiver starts receiving. (5) Notes 1) Baud rate generator for IrDA To generate baud rate for IrDA, use baud rate generator in SIO0 by setting "01" to SC0MOD0. To use another source (TA0TRG, fSYS and SCLK0 input) are not allowed. 2) As the IrDA 1.0 physical layer specification, the data transfer speed and infra-red pulse width is specified. The IrDA 1.0 specification is defined in Table 3.9.5.
Table 3.9.5 Baud Rate and Pulse Width Specifications Baud Rate
2.4 kbps 9.6 kbps 19.2 kbps 38.4 kbps 57.6 kbps 115.2 kbps
Modulation
RZI RZI RZI RZI RZI RZI
Rate Tolerance (% of rate)
0.87 0.87 0.87 0.87 0.87 0.87
Pulse Width (Minimum)
1.41 s 1.41 s 1.41 s 1.41 s 1.41 s 1.41 s
Pulse Width (Typical)
78.13 s 19.53 s 9.77 s 4.88 s 3.26 s 1.63 s
Pulse width (Maximum)
88.55 s 22.13 s 11.07 s 5.96 s 4.34 s 2.23 s
The pulse width is defined either baud rate TX 3/16 or 1.6 s (1.6 s is equal to 3/16 pulse width when baud rate is 115.2 kbps). The TMP91C820A has the function selects the pulse width of transmission either 3/16 or 1/16. But 1/16 pulse width can be selected when the baud rate is equal or less than 38.4 kbps. As the same reason, + (16 - K)/16 division function in the baud rate generator of SIO0 can not be used to generate 115.2 kbps baud rate. Also when the 38.4 kbps and 1/16 pulse width, + (16 - K)/16 division function can not be used.
Table 3.9.6 Baud Rate and Pulse Width for (16 - K)/16 Division Function Pulse Width
T x 3/16 T x 1/16
Baud Rate 115.2 kbps 57.6 kbps 38.4 kbps 19.2 kbps x - - x 9.6 kbps 2.4 kbps
: Can be used (16 - K)/16 division function.
x: Can not be used (16 - K)/16 division function. -: Can not be set to 1/16 pulse width.
91C820A-174
2006-01-31
TMP91C820A
7
SIRCR (0207H) Bit symbol Read/Write After reset Function 0
Select transmit pulse width 0: 3/16 1: 1/16
6
RXSEL 0
Receive data 0: H pulse 1: L pulse
5
TXEN 0
Transmit 0: Disable 1: Enable
4
RXEN 0
Receive 0: Disable 1: Enable
3
SIRWD3 R/W 0
2
SIRWD2 0
1
SIRWD1 0
0
SIRWD0 0
PLSEL
Select receive pulse width Set effective pulse width for equal or more than 2x x (Value + 1) + 100 ns Can be set: 1 to 14 Can not be set: 0, 15
Select receive pulse width Formula: Effective pulse width 2x x (Value + 1) + 100 ns x = 1/fFPH 0000 0001 to 1110 1111 Equal or more than 30x + 100ns Can not be set Cannot be set Equal or more than 4x + 100ns
Receive operation 0 1 Disabled Enabled
Transmit operation 0 1 Disabled Enabled
Select transmit pulse width 0 1 3/16 1/16
Note: If pulse width complying with the IrDA 1.0 standard (1.6 s min.) can be guaranteed with a low baud rate, setting this bit to "1" shortens the duration of infrared ray activation, resulting in reduced power dissipation.
Figure 3.9.33 IrDA Control Register
91C820A-175
2006-01-31
TMP91C820A
3.10 Serial Bus Interface (SBI)
The TMP91C820A has a one-channel serial bus interface which employs a clocked synchronous 8-bit SIO mode and an I2C bus mode. The serial bus interface is connected to an external device through P71 (SDA) and P72 (SCL) in the I2C bus mode; and through P70 (SCK), P71 (SO), P72 (SI) in the clocked synchronous 8-bit SIO mode. Each pin is specified as follows.
P7ODE I C bus mode Clocked synchronous 8-bit SIO mode X: Don't care
2
P7CR P7FC 11X 011 010 11X 111
11 XX
3.10.1
Configuration
INTSBI Interrupt request SCL SCK SIO clock control P70 (SCK) Input/ output control SIO I C bus clock Sysn. + Control
2
T
Divider Transfer control circuit data control
SO SI
P71 (SO/SDA)
Noise canceller
Shift register
I2C bus data control Noise canceller SDA
P72 (SI/SCL)
SBI0CR2/ SBI0SR SBI control register 2/ SBI status register
I2C0AR I2C bus address register
SBI0DBR SBI data buffer register
SBI0CR1 SBI control register 1
SBI0BR0, 1 SBI baud rate register 0, 1
Figure 3.10.1 Serial Bus Interface (SBI)
91C820A-176
2006-01-31
TMP91C820A 3.10.2 Serial Bus Interface (SBI) Control
The following registers are used to control the serial bus interface and monitor the operation status. * Serial bus interface control register 1 (SBI0CR1) * * * * * * Serial bus interface control register 2 (SBI0CR2) Serial bus interface data buffer register (SBI0DBR) I2C bus address register (I2C0AR) Serial bus interface status register (SBI0SR) Serial bus interface baud rate register 0 (SBI0BR0) Serial bus interface baud rate register 1 (SBI0BR1)
The above registers differ depending on a mode to be used. Refer to section 3.10.4 "I2C Bus Mode Control" and 3.10.7 "Clocked Synchronous 8-Bit SIO Mode Control".
3.10.3
The Data Formats in the I2C Bus Mode
The data formats in the I2C bus mode is shown below.
(a) Addressing format 8 bits S
Slave address
1 RA /C WK
1 to 8 bits Data
1 A C K 1 or more
1 to 8 bits Data
1 A CP K
1 (b) Addressing format (with restart) 8 bits S
Slave address
1 RA /C WK
1 to 8 bits Data 1 or more
1 A CS K
8 bits
Slave address
1 RA /C WK
1 to 8 bits Data 1 or more
1 A CP K
1
1
(c) Free data format (Data transferred from master device to slave device) 8 bits S
Data
1 A C K
1 to 8 bits Data
1 A C K 1 or more
1 to 8 bits Data
1 A CP K
1 S: Start condition
R/ W : Direction bit ACK: Acknowledge bit P: Stop condition
Figure 3.10.2 Data Format in the I2C Bus Mode
91C820A-177
2006-01-31
TMP91C820A 3.10.4 I2C Bus Mode Control
The following registers are used to control and monitor the operation status when using the serial bus interface (SBI) in the I2C bus mode.
Seirial Bus Interface Conrol Register 1
7
SBI0CR1 Bit symbol (0240H) Read/Write After Reset Function Prohibit readmodifywrite BC2
6
BC1 W
5
BC0
4
ACK R/W
3
2
SCK2 W
1
SCK1
0
SCK0/ SWRMON
R/W
0 0 Number of transferred bits (Note 1)
0
0 Acknowledge mode specification 0: Not generate 1: Generate
0 0 0/1 (Note 3) Internal serial clock selection and software reset monitor (Note 2)
Internal serial clock selection at write 000 n = 5 - (Note4) System clock: fc 001 n = 6 - (Note4) Clock gear: fc/1 010 n = 7 - (Note4) fc = 36 MHz 011 n = 8 - (Note4) (Internal SCL output) kHz 100 n = 9 69.2 kHz 101 n = 10 34.9 fscl = nfc [ Hz ] 2 +8 kHz 110 n = 11 17.5 (Reserved) 111 Software reset state monitor at read 0 1 During software reset Initial data
Acknowledge mode specification 0 1 Not generate clock pulse for acknowledge signal Generate clock pulse for acknowledge signal
Number of bits transferred = 0 000 001 010 011 100 101 110 111 Note 1: Set the to 000 before switching to a clock synchronous 8-bit SIO mode. Note 2: For the frequency of the SCL line clock, see 3.10.5 (3) "Serial clock". Note 3: Initial data of SCK0 is "0", SWRMON is "1". 2 2 Note 4: This I C bus circuit dose not support fast mode, it supports standard mode only. Although the I C bus circuit itself allows the setting of a baud rate over 100 kbps, the compliance with the I2C specification is not guaranteed in that case. Number of clock pulses 8 1 2 3 4 5 6 7 Bits 8 1 2 3 4 5 6 7 = 1 Number of clock Bits pulses 8 9 1 2 2 3 3 4 4 5 5 6 6 7 7 8
Figure 3.10.3 Registers for the I2C Bus Mode
91C820A-178
2006-01-31
TMP91C820A
Serial Bus Interface Control Register 2
7
SBI0CR2 (0243H) Bit symbol Read/Write After reset Prohibit readmodifywrite Function 0
Master/ slave selection
6
TRX W 0
Transmitter/ receiver selection
5
BB 0
Start/stop condition generation
4
PIN 1
Cancel INTSBI interrupt request
3
SBIM1 0 W (Note 1)
2
SBIM0 0
1
SWRST1 0 W (Note 1)
0
SWRST0 0
MST
Serial bus interface operating mode selection (Note 2) 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
Software reset generate write 10 and 01, then an internal reset signal is generated.
Serial bus interface operating mode selection (Note 2) 00 Port mode (Serial bus interface output disabled) 01 Clocked synchronous 8-bit SIO mode 10 I C bus mode 11 (Reserved) INTSBI interrupt request 0 1 Don't care Cancel interrupt request
2
Start/stop condition generation 0 1 Generates the stop condition Generates the start condition
Transmitter/receiver selection 0 1 Receiver Transmitter
Master/slave selection 0 1 Note 1: Note 2: Reading this register function as SBI0SR register. Switch a mode to port mode after confirming that the bus is free. Switch a mode between I C bus mode and clock synchronous 8-bit SIO mode after confirming that input signals via port are high level.
2
Slave Master
Figure 3.10.4 Registers for the I2C Bus Mode
91C820A-179
2006-01-31
TMP91C820A
Serial Bus Interface Status Register
7
SBI0SR (0243H) Bit symbol Read/Write After reset Function Prohibit readmodifywrite 0 Master/ slave status monitor MST
6
TRX
5
BB
4
PIN R 1 INTSBI interrupt request monitor
3
AL 0
2
AAS 0
1
AD0 0
GENERAL CALL detection monitor 0: Undetected 1: Detected
0
LRB 0 Last received bit monitor 0: 0 1: 1
0 0 Transmitter/ I2C bus receiver status status monitor monitor
Slave address Arbitration lost detection match detection monitor 0: Undetected monitor 1: Detected 0: Undetected 1: Detected
Last received bit monitor 0 1 Last received bit was 0 Last received bit was 1
GENERAL CALL detection monitor 0 1 Undetected GENERAL CALL detected
Slave address match detection monitor 0 1 Undetected Slave address match or GENERAL CALL detected
Arbitration lost detection monitor 0 1 - Arbitration lost
INTSBI interrupt request monitor 0 1
2
Interrupt requested Interrupt canceled
I C bus status monitor 0 1 Free Busy
Transmitter/receiver status monitor 0 1 Receiver Transmitter
Master/slave status monitor 0 1 Note: Writing in this register functions as SBI0CR2. Slave Master
Figure 3.10.5 Registers for the I2C Bus Mode
91C820A-180
2006-01-31
TMP91C820A
Serial Bus Interface Baud Rate Regster 0
7
SBI0BR0 (0244H)
Prohibit readmodifywrite
6
I2SBI0 R/W 0 IDLE2 0: Stop 1: Run
5
4
3
2
1
0
Bit symbol Read/Write After reset Function
- W 0 Always write "0".
Operation during IDLE 2 mode 0 1 Stop Operation
Serial Bus Interface Baud Rate Register 1
7
SBI0BR1 (0245H)
Prohibit readmodifywrite
6
- W
5
4
3
2
1
0
Bit symbol Read/Write After reset Function
P4EN W
0 0 Internal Always clock write "0". 0: Stop 1: Operate
Baud rate clock control 0 1 Stop Operate
Sirial Bus Interface Data Buffer Register
7
SBI0DBR (0241H)
Prohibit readmodifywrite
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
Bit symbol Read/Write After reset Note 1: Note 2:
DB7
R (Received)/W (Transfer) Undefined When writing transmitted data, start from the MSB (Bit7). Receiving data is placed from LSB (Bit0). SBI0DBR can't be read the written data. Therefore read-modify-write instruction (e.g., "BIT" instruction) is prohibitted.
Note 3:
Written data in SBI0DBR is cleared by INTSBI signal.
I C Bus Address Register
2
7
I2C0AR (0242H)
Prohibit readmodifywrite
6
SA5 0
5
SA4 0
4
SA3 W 0
3
SA2 0
2
SA1 0
1
SA0 0
0
ALS 0
Address recognition mode specification
Bit symbol Read/Write After reset Function
SA6 0
Slave address selection for when device is operating as slave device
Address recognition mode specification 0 1 Slave address recognition Non slave address recognition
Figure 3.10.6 Registers for the I2C Bus Mode
91C820A-181
2006-01-31
TMP91C820A 3.10.5 Control in I2C Bus Mode
(1) Acknowledge mode specification Set the SBI0CR1 to 1 for operation in the acknowledge mode. The TMP91C820A generates an additional clock pulse for an acknowledge signal when operating in master mode. In the transmitter mode during the clock pulse cycle, the SDA pin is released in order to receive the acknowledge signal from the receiver. In the receiver mode during the clock pulse cycle, the SDA pin is set to the low in order to generate the acknowledge signal. Clear the to 0 for operation in the non-acknowledge mode. The TMP91C820A does not generate a clock pulse for the acknowledge signal when operating in the master mode. (2) Number of transfer bits The SBI0CR1 is used to select a number of bits for next transmitting and receiving data. Since the is cleared to 000 as a start condition, a slave address and direction bit transmission are executed in 8 bits. Other than these, the retains a specified value. (3) Serial clock a. Clock source The SBI0CR1 is used to select a maximum transfer frequency outputted on the SCL pin in master mode. Set a communication baud rate that meets the I2C bus specification, such as the shortest pulse width of tLOW, based on the equations shown below.
tHIGH tLOW 1/fscl
SBI0CR1 tLOW = 2
n-1
n 5 6 7 8 9 10 11
/fSBI
tHIGH = 2n-1/fSBI + 8/fSBI fscl = 1/(tLOW + tHIGH) fSBI = n 2 +8
000 001 010 011 100 101 110
Note 1: fSBI shows fFPH. Note 2: It's prohibit to use fc/16 prescaler clock when using SBI block. (I2C bus and clock synchronous.)
Figure 3.10.7 Clock Source
91C820A-182
2006-01-31
TMP91C820A
b. Clock synchronization In the I2C bus mode, in order to wired-AND a bus, a master device which pulls down a clock line to low level, in the first place, invalidate a clock pulse of another master device which generates a high-level clock pulse. The master device with a high-level clock pulse needs to detect the situation and implement the following procedure. The TMP91C820A has a clock synchronization function for normal data transfer even when more than one master exists on the bus. The example explains the clock synchronization procedures when two masters simultaneously exist on a bus.
Wait counting high-level width of a clock pulse Start couting high-level width of a clock pulse Internal SCL output (Master A) Internal SCL output (Master B) SCL line a b c Reset a acounter of high-level width of a clock pulse
Figure 3.10.8 Clock Synchronization As master A pulls down the internal SCL output to the low level at point a, the SCL line of the bus becomes the low level. After detecting this situation, master B resets a counter of high-level width of an own clock pulse and sets the internal SCL output to the low level. Master A finishes counting low-level width of an own clock pulse at point b and sets the internal SCL output to the high level. Since master B holds the SCL line of the bus at the low level, master A wait for counting high-level width of an own clock pulse. After master B finishes counting low-level width of an own clock pulse at point c and master A detects the SCL line of the bus at the high-level, and starts counting high level of an own clock pulse. The clock pulse on the bus is determined by the master device with the shortest high-level width and the master device with the longest low-level width from among those master devices connected to the bus. (4) Slave address and address recognition mode specification When the TMP91C820A is used as a slave device, set the slave address and to the I2C0AR. Clear the to 0 for the address recognition mode. (5) Master/slave selection Set the SBI0CR2 to 1 for operating the TMP91C820A as a master device. Clear the SBI0CR2 to 0 for operation as a slave device. The is cleared to 0 by the hardware after a stop condition on the bus is detected or arbitration is lost.
91C820A-183
2006-01-31
TMP91C820A
(6) Transmitter/receiver selection Set the SBI0CR2 to 1 for operating the TMP91C820A as a transmitter. Clear the to 0 for operation as a receiver. When data with an addressing format is transferred in slave mode, when a slave address with the same value that an I2C0AR or a GENERAL CALL is received (All 8-bit data are 0 after a start condition), the is set to 1 by the hardware if the direction bit (R/ W ) sent from the master device is 1, and is cleared to 0 by the hardware if the bit is 0. In the master mode, after an acknowledge signal is returned from the slave device, the is cleared to 0 by the hardware if a transmitted direction bit is 1, and is set to 1 by the hardware if it is 0. When an acknowledge signal is not returned, the current condition is maintained. The is cleared to 0 by the hardware after a stop condition on the I2C bus is detected or arbitration is lost. (7) Start/stop condition generation When the SBI0SR is 0, slave address and direction bit which are set to SBI0DBR are output on a bus after generating a start condition by writing 1 to the SBI0CR2 . It is necessary to set transmitted data to the data buffer register (SBI0DBR) and set 1 to beforehand.
SCL line
1
2
3
4
5
6
7
8
9
SDA line Start condition
A6
A5
A4
A3
A2
A1
A0
R/W Acknowledge signal
Slave address and the direction bit
Figure 3.10.9 Start Condition Generation and Slave Address Generation When the is 1, a sequence of generating a stop condition is started by writing 1 to the , and 0 to the . Do not modify the contents of until a stop condition is generated on a bus.
SCL line SDA line Stop condition
Figure 3.10.10 Stop Condition Generation The state of the bus can be ascertained by reading the contents of SBI0SR. SBI0SR will be set to 1 if a start condition has been detected on the bus, and will be cleared to 0 if a stop condition has been detected. And about generation of stop condition in master mode, there are some limitation point. Please refer to 3.10.6 (4) "Stop condition generation".
91C820A-184
2006-01-31
TMP91C820A
(8) Interrupt service requests and interrupt cancellation When a serial bus interface interrupt request (INTSBI) occurs, the SBI0CR2 is cleared to 0. During the time that the SBI0CR2 is 0, the SCL line is pulled down to the low level. The is cleared to 0 when a 1 word of data is transmitted or received. Either writing/reading data to/from SBI0DBR sets the to 1. The time from the being set to 1 until the SCL line is released takes tLOW. In the address recognition mode ( = 0), is cleared to 0 when the received slave address is the same as the value set at the I2C0AR or when a GENERAL CALL is received (All 8-bit data are 0 after a start condition). Although SBI0CR2 can be set to 1 by the program, the is not clear it to 0 when it is written 0. (9) Serial bus interface operation mode selection SBI0CR2 is used to specify the serial bus interface operation mode. Set SBI0CR2 to 10 when the device is to be used in I2C bus mode after confirming pin condition of serial bus interface to "H". Switch a mode to port after confirming a bus is free. (10) Arbitration lost detection monitor Since more than one master device can exist simultaneously on the bus in I2C bus mode, a bus arbitration procedure has been implemented in order to guarantee the integrity of transferred data. Data on the SDA line is used for I2C bus arbitration. The following shows an example of a bus arbitration procedure when two master devices exist simultaneously on the bus. Master A and master B output the same data until point a. After master A outputs L and master B, H, the SDA line of the bus is wire-AND and the SDA line is pulled down to the low-level by master A. When the SCL line of the bus is pulled up at point b, the slave device reads the data on the SDA line, that is, data in master A. A data transmitted from master B becomes invalid. The state in master B is called "ARBITRATION LOST". Master B device, which loses arbitration releases the internal SDA output in order not to affect data, transmitted from other masters with arbitration. When more than one master sends the same data at the first word, arbitration occurs continuously after the second word.
SCL line Internal SDA output (Master A) Internal SDA output (Master A) SDA line a b Internal SDA output becomes 1 after arbitration has been lost.
Figure 3.10.11 Arbitration Lost
91C820A-185
2006-01-31
TMP91C820A
The TMP91C820A compares the levels on the bus's SDA line with those of the internal SDA output on the rising edge of the SCL line. If the levels do not match, arbitration is lost and SBI0SR is set to 1. When SBI0SR is set to 1, SBI0SR are cleared to 00 and the mode is switched to slave receiver mode. Thus, clock output is stopped in data transfer after setting = "1". SBI0SR is cleared to 0 when data is written to or read from SBI0DBR or when data is written to SBI0CR2.
Internal SCL output Internal SDA output Internal SCL output Internal SDA output 1 2 3 4 5 6 7 8 9 1 2 3 4
Master A
D7A
D6A
D4A
D3A
D2A
D1A
D0A
D7A' D6A' D5A' D4A'
Stop the clock pulse 1 2 3 4
Master B
D7B
D6B
Keep internal SDA output to high level as losing arbitration

Accessed to SBI0DBR or SBI0CR2
Figure 3.10.12 Example of when TMP91C820A is a Master Device B (D7A = D7B, D6A = D6B) (11) Slave address match detection monitor SBI0SR is set to 1 in slave mode, in address recognition mode (e.g., when I2C0AR = 0), when a GENERAL CALL is received, or when a slave address matches the value set in I2C0AR. When I2C0AR = 1, SBI0SR is set to 1 after the first word of data has been received. SBI0SR is cleared to 0 when data is written to or read from the data buffer register SBI0DBR. (12) GENERAL CALL detection monitor SBI0SR is set to 1 in slave mode, when a GENERAL CALL is received (All 8-bit received data is 0, after a start condition). SBI0SR is cleared to 0 when a start condition or stop condition is detected on the bus. (13) Last received bit monitor The SDA line value stored at the rising edge of the SCL line is set to the SBI0SR. In the acknowledge mode, immediately after an INTSBI interrupt request is generated, an acknowledge signal is read by reading the contents of the SBI0SR.
91C820A-186
2006-01-31
TMP91C820A
(14) Software reset function The software reset function is used to initialize the SBI circuit, when SBI is rocked by external noises, etc. An internal reset signal pulse can be generated by setting SBI0CR2 to 10 and 01. This initializes the SBI circuit internally. All command (except SBI0CR2) registers and status registers are initialized as well. SBI0CR1 is automatically set to 1 after the SBI circuit has been initialized. (15) Serial bus interface data buffer register (SBI0DBR) The received data can be read and transferred data can be written by reading or writing the SBI0DBR. In the master mode, after the start condition is generated the slave address and the direction bit are set in this register. (16) I2CBUS address register (I2C0AR) I2C0AR is used to set the slave address when the TMP91C820A functions as a slave device. The slave address output from the master device is recognized by setting the I2C0AR to 0. The data format is the addressing format. When the slave address is not recognized at the = 1, the data format is the free data format. (17) Baud rate register (SBI0BR1) Write 1 to SBI0BR1 before operation commences. (18) Setting register for IDLE2 mode operation (SBI0BR0) SBI0BR0 is the register setting operation/stop during IDLE2 mode. Therefore, setting is necessary before the HALT instruction is executed.
91C820A-187
2006-01-31
TMP91C820A 3.10.6 Data Transfer in I2C Bus Mode
(1) Device initialization Set the SBI0BR1, SBI0CR1, set SBI0BR1 to 1 and clear bits 7 to 5 and 3 in the SBI0CR1 to 0. Set a slave address and the ( = 0 when an addressing format) to the I2C0AR. For specifying the default setting to a slave receiver mode, clear 0 to the and set 1 to the , 10 to the . (2) Start condition and slave address generation a. Master mode In the master mode, the start condition and the slave address are generated as follows. Check a bus free status (when = 0). Set the SBI0CR1 to 1 (Acknowledge mode) and specify a slave address and a direction bit to be transmitted to the SBI0DBR. When SBI0CR2 = 0, the start condition are generated by writing 1111 to SBI0CR2. Subsequently to the start condition, nine clocks are output from the SCL pin. While eight clocks are output, the slave address and the direction bit which are set to the SBI0DBR. At the 9th clock, the SDA line is released and the acknowledge signal is received from the slave device. An INTS2 interrupt request occurs at the falling edge of the 9th clock. The is cleared to 0. In the master mode, the SCL pin is pulled down to the low-level while is 0. When an interrupt request occurs, the is changed according to the direction bit only when an acknowledge signal is returned from the slave device. b. Slave mode In the slave mode, the start condition and the slave address are received. After the start condition is received from the master device, while eight clocks are output from the SCL pin, the slave address and the direction bit which are output from the master device are received. When a GENERAL CALL or the same address as the slave address set in I2C0AR is received, the SDA line is pulled down to the low level at the 9th clock, and the acknowledge signal is output. An INTSBI interrupt request occurs on the falling edge of the 9th clock. The is cleared to 0. In slave mode the SCL line is pulled down to the low level while the = 0.
SCL line SDA line 1 A6 Start condtion INTSBI interrupt request 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8
R/ W
9 ACK Acknowledge signal from a slave device
Slave address + Direction bit
Output of master Output of slave
Figure 3.10.13 Start Condition Generation and Slave Address Transfer
91C820A-188
2006-01-31
TMP91C820A
(3) 1-word data transfer Check the by the INTSBI interrupt process after the 1-word data transfer is completed, and determine whether the mode is a master or slave. a. If = 1 (Master mode) Check the and determine whether the mode is a transmitter or receiver. When the = 1 (Transmitter mode) Check the . When is 1, a receiver does not request data. Implement the process to generate a stop condition (Refer to 3.10.6 (4)) and terminate data transfer. When the is 0, the receiver is requests new data. When the next transmitted data is 8 bits, write the transmitted data to SBI0DBR. When the next transmitted data is other than 8 bits, set the , set the to 1 and write the transmitted data to SBI0DBR. After written the data, becomes 1, a serial clock pulse is generated for transferring a new 1 word of data from the SCL pin, and then the one-word data is transmitted. After the data is transmitted, an INTSBI interrupt request occurs. The becomes 0 and the SCL line is pulled down to the low level. If the data to be transferred is more than one word in length, repeat the procedure from the checking above.
Write to SBI0DBR SCL line 1 2 3 4 5 6 7 8 9
SDA line
D7
D6
D5
D4
D3
D2
D1
D0
ACK Acknowledge signal from a receiver
INTSBI interrupt request Output from master Output from slave
Figure 3.10.14 Example in which = 000 and = 1 in Transmitter Mode
91C820A-189
2006-01-31
TMP91C820A
When the = 0 (Receiver mode) When the next transmitted data is other than 8 bits, set again. Set to 1 and read the received data from SBI0DBR to release the SCL line (Data which is read immediately after a slave address is sent is undefined). After the data is read, becomes 1. Serial clock pulse for transferring new 1 data is defined SCL and outputs "L" level from SDA pin with acknowledge timing. An INTSBI interrupt request then occurs and the becomes 0. Then the TMP91C820A pulls down the SCL pin to the low level. The TMP91C820A outputs a clock pulse for 1 word of data transfer and the acknowledge signal each time that received data is read from the SBI0DBR.
Read SBI0DBR SCL line 1 2 3 4 5 6 7 8 9
SDA line
D7
D6
D5
D4
D3
D2
D1
D0
ACK
New D7
Acknowledge signal to a transmitter
INTSBI interrupt request
Output from master Output from slave
Figure 3.10.15 Example of when = 000, = 1 in Receiver Mode In order to terminate the transmission of data to a transmitter, clear to 0 before reading data which is 1 word before the last data to be received. The last data word does not generate a clock pulse as the acknowledge signal. After the data has been transmitted and an interrupt request has been generated, set to 001 and read the data. The TMP91C820A generates a clock pulse for a 1-bit data transfer. Since the master device is a receiver, the SDA line on the bus remains high. The transmitter interprets the high signal as an ACK signal. The receiver indicates to the transmitter that data transfer is complete. After the one data bit has been received and an interrupt request been generated, the TMP91C820A generates a stop condition (See Section 3.10.6 (4)) and terminates data transfer.
SCL line 1 2 3 4 5 6 7 8 1
SDA line
D7
D6
D5
D4
D3
D2
D1
D0
Acknowledge signal sent to a transmitter
INTSBI interrupt request 0 read SBI0DBR 001 read SBI0DBR Output of master Output of slave
Figure 3.10.16 Termination of Data Transfer in Master Receiver Mode
91C820A-190
2006-01-31
TMP91C820A
b. If = 0 (Slave mode) In the slave mode the TMP91C820A operates either in normal slave mode or in slave mode after losing arbitration. In the slave mode, an INTSBI interrupt request occurs when the TMP91C820A receives a slave address or a GENERAL CALL from the master device, or when a GENERAL CALL is received and data transfer is complete, or after matching received address. In the master mode, the TMP91C820A operates in a slave mode if it losing arbitration. An INTSBI interrupt request occurs when a word data transfer terminates after losing arbitration. When an INTSBI interrupt request occurs the is cleared to 0 and the SCL pin is pulled down to the low-level. Either reading/writing from/to the SBI0DBR or setting the to 1 will release the SCL pin after taking tLOW time. Check the SBI0SR, , , and and implements processes according to conditions listed in the next table.
Table 3.10.1 Operation in the Slave Mode
1

1

1 0
Conditions
The TMP91C820A loses arbitration when transmitting a slave address and receives a slave address for which the value of the direction bit sent from another master is 1. In salve receiver mode the TMP91C820A receives a slave address for which the value of the direction bit sent from the master is 1. In salve transmitter mode a single word of is transmitted. Set to the number of bits in a word.
Process
Set the number of bits a word in and write the transmitted data to SBI0DBR.
0
1
0
0
0
Check the setting. If is set to 1, set to 1 since the receiver win no request the data which follows. Then, clear to 0 to release the bus. If is cleared to 0 of and write the transmitted data to SBI0DBR since the receiver requests next data. Read the SBI0DBR for setting the to 1 (Reading dummy data) or set the to 1.
0
1
1
1/0
The TMP91C820A loses arbitration when transmitting a slave address and receives a slave address or GENERAL CALL for which the value of the direction bit sent from another master is 0. The TMP91C820A loses arbitration when transmitting a slave address or data and terminates word data transfer. In slave receiver mode the TMP91C820A receives a slave address or GENERAL CALL for which the value of the direction bit sent from the master is 0. In slave receiver mode the TMP91C820A terminates receiving word data.
0
0
0
1
1/0
0
1/0
Set to the number of bits in a word and read the received data from SBI0DBR.
91C820A-191
2006-01-31
TMP91C820A
(4) Stop condition generation When the SBI0SR is "1", the sequence of generating a stop condition is started by setting "111" to the SBI0CR2 and "0" to the SBI0CR2. Do not modify the contents of the SBI0CR2 until a stop condition is generated on a bus. When a SCL line of bus is pulled down by other devices, this device generates a stop condition after they release a SCL line and the SDA becomes "1".
1 1 0 1 SCL0 line
Stop condition
SDA0 line

(Read)
Figure 3.10.17 Stop Condition Generation (Single master)
1 1 0 1 Internal SCL The case of pulled low by another device
Stop condition
SCL pin
SDA pin
(Read)
Figure 3.10.18 Stop Condition Generation (Multi master)
91C820A-192
2006-01-31
TMP91C820A
(5) Restart Restart is used to change the direction of data transfer between a master device and a slave device during transferring data. The following explains how to restart when the TMP91C820A is in the master mode. Clear 0 to the SBI0CR2, and set 1 to the and release the bus. The SDA line remains the high level and the SCL pin is released. Since a stop condition is not generated on a bus, a bus is assumed to be in a busy state from other devices. Check the SBI0SR until it becomes 0 to check that the TMP91C820A is released. Check the until it becomes 1 to check that the SCL line on a bus is not pulled down to the low level by other devices. After confirming that a bus stays in a free state, generate a start condition with procedure 3.10.6 (2). In order to meet setup time when restarting, take at least 4.7 s of waiting time by software from the time of restarting to confirm that the bus is free until the time to generate the start condition.
0 0 0 1 1 1 1 1 4.7 [s] (Min) SCL line Internal SCL output (TMP91C820A) SDA line 9 Start codnition

Figure 3.10.19 Timing Diagram for TMP91C820A Restart
91C820A-193
2006-01-31
TMP91C820A 3.10.7 Clocked Synchronous 8-Bit SIO Mode control
The following registers are used to control and monitor the operation status when the serial bus interface (SBI) is being operated in clocked synchronous 8-bit SIO mode.
Serial Bus Interface Control Register 1
7
SBI0CR1 Bit symbol (0240H) Read/Write After reset Function
Prohibit readmodifywrite
6
SIOINH W 0
5
SIOM1 0
4
SIOM0 0
3
2
SCK2 W 0
1
SCK1 0
0
SCK0 W 0
SIOS 0
Transfer start Continue/ 0: Stop abort transfer 1: Start 0: Continue transfer 1: Abort transfer
Transfer mode select 00: Transmit mode 01: (Reserved) 10: Transmit/receive mode 11: Receive mode
Serial clock selection and reset monitor
Serial clock selection at write 000 n = 4 2.3 MHz 001 n = 5 1125.0 kHz System clcok: fc 010 n = 6 562.5 kHz Clock gear: fc/1 011 n = 7 281.3 kHz fc = 36 MHz 100 n = 8 140.6 kHz (Output to SCK pin) 101 n = 9 70.3 kHz fc [Hz] 110 n = 10 35.2 kHz fscl = n 2 111 - External clock (Inputted from sck pin ) Transfer mode selection 00 8-bit transmit mode 01 (Reserved) 10 8-bit transmit/received mode 11 8-bit received mode Continue/abort transfer 0 1 Continue transfer Abort transfer (Automatically cleared after transfer aborted) Transfer start/stop 0 1 Note: Stopped Started
Set the tranfer mode and the serial clock after setting to 0 and to 1. Serial Bus Interface Data Buffer Register
SBI0DBR (0241H)
Prohibit readmodifywrite
7
Bit symbol Read/Write After reset DB7
6
DB6
5
DB5
4
DB4
3
DB3
2
DB2
1
DB1
0
DB0
R (Receiver)/W (Transfer) Undefined
Figure 3.10.20 Register for the SIO Mode (1/3)
91C820A-194
2006-01-31
TMP91C820A
Serial Bus Interface Control Register 2
7
SBI0CR2 (0242H)
Prohibit readmodifywrite
6
5
4
3
SBIM1 W 0
2
SBIM0 0
1
- W 0 (Note 2)
0
- W 0 (Note 2)
Bit symbol Read/Write After reset Function
Serial bus interface operation mode selection 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
Serial bus interface operation mode selection 00 Port mode (Serial bus interface output disabled) 01 Clocked synchronous 8-bit SIO mode 10 I C bus mode 11 (Reserved) Note 1: Note 2: Set the SBI0CR1 000 before switching to a clocked synchronous 8-bit SIO mode. Please always write "00" to SBICR2<1:0>.
2
Serial Bus Interface Status Register
7
SBI0SR (0243H) Bit symbol Read/Write After reset Function
6
5
4
3
SIOF R 0 Serial transfer operation status monitor
2
SEF 0 Shift operation status monitor
1
0
Shift operation status monitor 0 1 0 1 Shift operation terminated Shift operation in progress Transfer terminated Transfer in progress
Serial transfer operating status monitor
Figure 3.10.21 Registers for the SIO Mode (2/3)
91C820A-195
2006-01-31
TMP91C820A
Serial Bus Interface Baud Rate Register 0
7
SBI0BR0 (0244H)
Prohibit readmodifywrite
6
I2SBI0 R/W 0 IDLE2 0: STOP 1: RUN
5
4
3
2
1
0
Bit symbol Read/Write After reset Function
- W 0 Always write "0".
Operation in IDLE 2 mode 0 1 Serial Bus Interface Baud Rate Register 1 Stop Operate
7
SBI0BR1 (0245H)
Prohibit readmodifywrite
6
- W
5
4
3
2
1
0
Bit symbol Read/Write After reset Function
P4EN W
0 0 Internal Always clock write "0". 0: Stop 1: Operate
Baud rate clock control 0 1 Stop Operate
Figure 3.10.22 Registers for the SIO Mode (3/3)
91C820A-196
2006-01-31
TMP91C820A
(1) Serial Clock a. Clock source SBI0CR1 is used to select the following functions: Internal clock In internal clock mode one of seven frequencies can be selected. The serial clock signal is output to the outside on the SCK pin. When the device is writing (in transmit mode) or reading (in receive mode), data cannot follow the serial clock rate, so an automatic wait function is executed which automatically stops the serial clock and holds the next shift operation until reading or writing has been completed.
Automatic wait function SCK pin output 1 2 3 7 8 1 2 6 7 8 1 2 3
SO pin output Write transmitted data a
a0
a1
a2 a5
a6
a7
b0 b
b1 c
b4
b5
b6
b7
c0
c1
c2
Figure 3.10.23 Automatic Wait Function External clock ( = 111) An external clock input via the SCK pin is used as the serial clock. In order to ensure the integrity of shift operations, both the high and low-level serial clock pulse widths shown below must be maintained. The maximum data transfer frequency is 2.3 MHz (when fc = 36 MHz).
SCK pin
tSCKL tSCKH tSCKL, tSCKH > 8/fc at prescaler clock = fc
Figure 3.10.24 Maximum Data Transfer Frequency when External Clock Input Used
91C820A-197
2006-01-31
TMP91C820A
b. Shift edge Data is transmitted on the leading edge of the clock and received on the trailing edge. Leading edge shift Data is shifted on the leading edge of the serial clock (on the falling edge of the SCK pin input/output). Trailing edge shift Data is shifted on the trailing edge of the serial clock (on the rising edge of the SCK pin input/output).
SCK pin output
SO pin output
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
Shift register
76543210 *7654321 **765432 ***76543
****7654
*****765
******76
******7
(a) Leading edge
SCK pin
SI pin
Bit0
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
Shift register
*: Don't care
********
0*******
10******
210*****
3210****
43210***
543210** 6543210* 76543210
(b) Trailing edge
Figure 3.10.25 Shift Edge
91C820A-198
2006-01-31
TMP91C820A
(2) Transfer modes The SBI0CR1 is used to select a transmit, receive or transmit/receive mode. a. 8-bit transmit mode Set a control register to a transmit mode and write transmit data to the SBI0DBR. After the transmit data is written, set the SBI0CR1 to 1 to start data transfer. The transmitted data is transferred from SBI0DBR to the shift register and output to the SO pin in synchronized with the serial clock, starting from the least significant bit (LSB), When the transmission data is transferred to the shift register, the SBI0DBR becomes empty. An INTSBI (Buffer empty) interrupt request is generated to request new data. When the internal clock is used, the serial clock will stop and automatic-wait function will be initiated if new data is not loaded to the data buffer register after the specified 8-bit data is transmitted. When new transmit data is written, automatic-wait function is canceled. When the external clock is used, data should be written to SBI0DBR before new data is shifted. The transfer speed is determined by the maximum delay time between the time when an interrupt request is generated and the time when data is written to SBI0DBR by the interrupt service program. When the transmit is started, after the SBI0SR goes 1 output from the SO pin holds final bit of the last data until falling edge of the SCK. Transmitting data is ended by clearing the to 0 by the buffer empty interrupt service program or setting the to 1. When the is cleared, the transmitted mode ends when all data is output. In order to confirm if data is surely transmitted by the program, set the (Bit3 of SBI0SR) to be sensed. The SBI0SR is cleared to 0 when transmitting is complete. When the is set to 1, transmitting data stops. SBI0SR turns 0. When an external clock is used, it is also necessary to clear SBI0SR to 0 before new data is shifted; otherwise, dummy data is transmitted and operation ends.
91C820A-199
2006-01-31
TMP91C820A
Example: Program to stop data transmission (when an external clock is used)
Clear SCK pin (Output) SO pin INTSBI interrupt request SBI0DBR a b (a) Internal clock Write transmitted data
*
a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
Clear SCK pin (Input) SO pin INTSBI interrupt request SBI0DBR a b (b) External clock Write transmitted data
*
a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
Figure 3.10.26 Transfer Mode
STEST1: BIT 2, (SBI0SR) ; If = 1 then loop JRNZ, STEST1 STEST2: BIT 0, (P7) ; If SCK = 0 then loop JRZ, STEST2 LD (SBI0CR1), 00000111B ; 0
91C820A-200
2006-01-31
TMP91C820A
b. 8-bit receive mode
SCK pin SIOF SO pin Bit6 Bit7 tSODH = Min 3.5/fFPH [s]
Figure 3.10.27 Transmitted Data Hold Time at End of Transmission Set the control register to receive mode and set SBI0CR1 to 1 for switching to receive mode. Data is received into the shift register via the SI pin and synchronized with the serial clock, starting from the least significant bit (LSB). When 8-bit data is received, the data is transferred from the shift register to SBI0DBR. An INTSBI (Buffer full) interrupt request is generated to request that the received data be read. The data is then read from SBI0DBR by the interrupt service program. When an internal clock is used, the serial clock will stop and the automatic wait function will be in effect until the received data has been read from SBI0DBR. When an external clock is used, since shift operation is synchronized with an external clock pulse, the received data should be read from SBI0DBR before the next serial clock pulse is input. If the received data is not read, any further data, which is to be received, is canceled. The maximum transfer speed when an external clock is used is determined by the delay time between the time when an interrupt request is generated and the time when the received data is read. Receiving of data ends when is cleared to 0 by the buffer full interrupt service program or when is set to 1. If is cleared to 0, received data is transferred to SBI0DBR in complete blocks. The received mode ends when the transfer is complete. In order to confirm whether data is being received properly by the program, set SBI0SR to be sensed. is cleared to 0 when receiving has been completed. When it is confirmed that receiving has been completed, the last data is read. When is set to 1, data receiving stops. is cleared to 0. (The received data becomes invalid, therefore no need to read it.) Note: When the transfer mode is changed, the contents of SBI0DBR will be lost. If the mode must be changed, conclude data receiving by clearing to 0, read the last data, and then change the mode.
91C820A-201
2006-01-31
TMP91C820A
Clear SCK pin (Output) SI pin INTSBI interrupt request SBI0DBR a Read receiver data b Read receiver data a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
Figure 3.10.28 Receiver Mode (Example: Internal clock) c. 8-bit transmit/receive mode Set a control register to a transmit/receive mode and write data to SBI0DBR. After the data has been written, set SBI0CR to 1 to start transmitting/receiving. When data is transmitted, the data is output via the SO pin, starting from the least significant bit (LSB) and synchronized with the leading edge of the serial clock signal. When data is received, the data is input via the SI pin on the trailing edge of the serial clock signal. 8-bit data is transferred from the shift register to SBI0DBR and an INTSBI interrupt request is generated. The interrupt service program reads the received data from the data buffer register and writes the data which is to be transmitted. SBI0DBR is used for both transmitting and receiving. Transmitted data should always be written after received data has been read. When an internal clock is used, the automatic wait function will be in effect until the received data has been read and the next data has been written. When an external clock is used, since the shift operation is synchronized with the external clock, received data is read and transmitted data is written before a new shift operation is executed. The maximum transfer speed when an external clock is used is determined by the delay time between the time when an interrupt request is generated and the time at which received data is read and transmitted data is written. When the transmit is started, after the SBI0SR goes 1 output from the SO pin holds final bit of the last data until falling edge of the SCK. Transmitting/receiving data ends when is cleared to 0 by the INTSBI interrupt service program or when SBI0CR1 is set to 1. When is cleared to 0, received data is transferred to SBI0DBR in complete blocks. The transmit/receive mode ends when the transfer is complete. In order to confirm whether data is being transmitted/received properly by the program; set SBI0SR to be sensed. is set to 0 when transmitting/receiving has been completed. When is set to 1, data transmitting/receiving stops. is then cleared to 0. Note: When the transfer mode is changed, the contents of SBI0DBR will be lost. If the mode must be changed, conclude data transmitting/receiving by clearing to 0, read the last data, then change the transfer mode.
91C820A-202
2006-01-31
TMP91C820A
Clear SCK pin (Output) SO pin SI pin INTSBI interrupt request SBI0DBR a Write transmitted data (a) Read received data (c) c b Write transmitted data (b) d Read received data (d)
*
a0 c0
a1 c1
a2 c2
a3 c3
a4 c4
a5 c5
a6 c6
a7 c7
b0 d0
b1 d1
b2 d2
b3 d3
b4 d4
b5 d5
b6 d6
b7 d7
Figure 3.10.29 Transmit/Received Mode (Example using internal clock)
SCK pin SIOF SO pin Bit6 Bit7 in last transmitted word tSODH = Min 4/fFPH [s]
Figure 3.10.30 Transmitted Data Hold Time at End of Transmit/Receive
91C820A-203
2006-01-31
TMP91C820A
3.11 Analog/Digital Converter
The TMP91C820A incorporates a 10-bit successive approximation-type analog/digital converter (AD converter) with 8-channel analog input. Figure 3.11.1 is a block diagram of the AD converter. The 8-channel analog input pins (AN0 to AN7) are shared with the input-only port 8 and can thus be used as an input port. Note: When IDLE2, IDLE1 or STOP mode is selected, so as to reduce the power, with some timings the system may enter a standby mode even though the internal comparator is still enabled. Therefore be sure to check that AD converter operations are halted before a HALT instruction is executed.
Internal data bus
AD mode control register 1 ADMOD1 ADMOD1
AD mode control register 0
ADMOD0

Decoder
Scan Repeat Interrupt Busy End Start AD converter control circuit INTAD interrupt ADTRG
Channel select Analog input AN7 (P87) AN6 (P86) AN5 (P85) AN4 (P84) AN3/ADTRG (P83) AN2 (P82) AN1 (P81) AN0 (P80) Multiplexer
AD conversion result Sample and hold + - Comparator register ADREG04L to ADREG37L ADREG04H to ADREG37H
VREFH VREFL
DA converter
Figure 3.11.1 Block Diagram of AD Converter
91C820A-204
2006-01-31
TMP91C820A 3.11.1 Analog/Digital Converter Registers
The two AD mode control registers control the AD converter: ADMOD0 and ADMOD1. The eight AD conversion data upper and lower registers (ADREG04H/L, ADREG15H/L, ADREG26H/L and ADREG37H/L) store the results of AD conversion. Figure 3.11.2 shows the registers related to the AD converter.
AD Mode Control Register 0
7
ADMOD0 (02B0H) Bit symbol Read/Write After reset Function EOCF R 0
AD conversion end flag 0: Conversion in progress 1: Conversion complete
6
ADBF R 0
5
- 0
4
- 0
3
ITM0 0 R/W
2
REPEAT 0
Repeat mode specification 0: Single conversion 1: Repeat conversion mode
1
SCAN 0
Scan mode specification 0: Conversion channel fixed mode 1: Conversion channel scan mode
0
ADS 0
AD conversion start 0: Don't care 1: Start conversion Always "0" when read.
Always write AD "0". conversion busy flag 0: Conversion stopped 1: Conversion in progress
Always write Interrupt "0". specification in conversion channel fixed repeat mode 0: Every conversion 1: Every fourth conversion
AD conversion start 0 1 Don't care Start AD conversion
Note: Always read as "0". AD scan mode setting 0 1 AD conversion channel fixed mode AD conversion channel scan mode
AD repeat mode setting 0 1 AD single conversion mode AD repeat conversion mode
Specify AD conversion interrupt for channel fixed repeat conversion mode Channel fixed repeat conversion mode = 0, = 1 0 1 Generates interrupt every conversion. Generates interrupt every fourth conversion.
AD conversion busy flag 0 1 AD conversion stopped AD conversion in progress
AD conversion end flag 0 1 Before or during AD conversion AD conversion complete
Figure 3.11.2 AD Converter Related Register
91C820A-205
2006-01-31
TMP91C820A
AD Mode Control Register 1
7
ADMOD1 (02B1H) Bit symbol Read/Write After reset Function VREFON R/W 0
VREF application control 0: OFF 1: ON
6
I2AD R/W 0
IDLE2 0: Stop 1: Operate
5
4
3
ADTRGE 0
AD external trigger start control 0: Disable 1: Enable
2
ADCH2 R/W 0
1
ADCH1 0
0
ADCH0 0
Analog input channel selection
Analog input channel selection 000 001 010 011 (Note) 100 101 110 111 0 Channel fixed AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN0 AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN4 AN4 AN5 AN4 AN5 AN6 AN4 AN5 AN6 AN7 1 Channel scanned
AD conversion start control by external trigger ( ADTRG input) 0 1 Disabled Enabled
IDLE2 control 0 1 Stopped In operation
Control of application of reference voltage to AD converter 0 1 OFF ON
Before starting conversion (before writing 1 to ADMOD0), set the bit to 1.
Note: As pin AN3 also functions as the ADTRG input pin, do not set = 011 when using ADTRG with set to 1.
Figure 3.11.3 AD Converter Related Register
91C820A-206
2006-01-31
TMP91C820A
AD Conversion Data Low Register 0/4
7
ADREG04L (02A0H) Bit symbol Read/Write After reset Function ADR01 R Undefined
6
ADR00
5
4
3
2
1
0
ADR0RF R 0
AD conversion data storage flag 1: Conversion result stored
Stores lower 2 bits of AD conversion result.
AD Conversion Data Upper Register 0/4
7
ADREG04H (02A1H) Bit symbol Read/Write After reset Function ADR09
6
ADR08
5
ADR07
4
ADR06 R Undefined
3
ADR05
2
ADR04
1
ADR03
0
ADR02
Stores upper 8 bits AD conversion result.
AD Conversion Data Lower Register 1/5
7
ADREG15L (02A2H) Bit symbol Read/Write After reset Function ADR11 R Undefined
6
ADR10
5
4
3
2
1
0
ADR1RF R 0
AD conversion result flag 1: Conversion result stored
Stores lower 2 bits of AD conversion result.
AD Conversion Data Upper Register 1/5
7
ADREG15H Bit symbol (02A3H) Read/Write After reset Function 9 Channel x conversion result ADR19
6
ADR18
5
ADR17
4
ADR16 R Undefined
3
ADR15
2
ADR14
1
ADR13
0
ADR12
Stores upper 8 bits of AD conversion result. 8 7 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2
ADREGxL 1 0
* Bits 5 to 1 are always read as 1 * Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.4 AD Converter Related Registers
91C820A-207
2006-01-31
TMP91C820A
AD Conversion Result Lower Register 2/6
7
ADREG26L (02A4H) Bit symbol Read/Write After reset Function ADR21 R Undefined
6
ADR20
5
4
3
2
1
0
ADR2RF R 0
AD conversion data storage flag 1: Conversion result stored
Stores lower 2 bits of AD conversion result.
AD Conversion Data Upper Register 2/6
7
ADREG26H (02A5H) Bit symbol Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R Undefined
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Stores upper 8 bits of AD conversion result.
AD Conversion Data Lower Register 3/7
7
ADREG37L (02A6H) Bit symbol Read/Write After reset Function ADR31 R Undefined
6
ADR30
5
4
3
2
1
0
ADR3RF R 0
AD conversion data storage flag 1: Conversion result stored
Stores lower 2 bits of AD conversion result.
AD Conversion Result Upper Register 3/7
7
ADREG37H (02A7H) Bit symbol Read/Write After reset Function 9 Channel x conversion result ADR39
6
ADR38
5
ADR37
4
ADR36 R Undefined
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Stores upper 8 bits of AD conversion result. 8 7 6 5 4 3 2 1 0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2
ADREGxL 1 0
* Bits 5 to1 are always read as 1. * Bit0 is the AD conversion data storage flag . When the AD conversion result is stored, the flag is set to 1. When either of the registers (ADREGxH, ADREGxL) is read, the flag is cleared to 0.
Figure 3.11.5 AD Converter Related Registers
91C820A-208
2006-01-31
TMP91C820A 3.11.2 Description of Operation
(1) Analog reference voltage A high-level analog reference voltage is applied to the VREFH pin; a low-level analog reference voltage is applied to the VREFL pin. To perform AD conversion, the reference voltage, the difference between VREFH and VREFL, is divided by 1024 using string resistance. The result of the division is then compared with the analog input voltage. To turn off the switch between VREFH and VREFL, write a 0 to ADMOD1 in AD mode control register 1. To start AD conversion in the OFF state, first write a 1 to ADMOD1, wait 3 s until the internal reference voltage stabilizes (This is not related to fc), then set ADMOD0 to 1. (2) Analog input channel selection The analog input channel selection varies depends on the operation mode of the AD converter. * In analog input channel fixed mode (ADMOD0 = 0) Setting ADMOD1 selects one of the input pins AN0 to AN7 as the input channel. In analog input channel scan mode (ADMOD0 = 1) Setting ADMOD1 selects one of the eight scan modes. Table 3.11.1 illustrates analog input channel selection in each operation mode. On a reset, ADMOD0 is set to 0 and ADMOD1 is initialized to 000. Thus pin AN0 is selected as the fixed input channel. Pins not used as analog input channels can be used as standard input port pins. Table 3.11.1 Analog Input Channel Selection
000 001 010 011 100 101 110 111
*
Channel Fixed = 0
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN0
Channel Scan = 1
AN0 AN1 AN0 AN1 AN2 AN0 AN1 AN2 AN3 AN4 AN4 AN5 AN4 AN5 AN6 AN4 AN5 AN6 AN7
91C820A-209
2006-01-31
TMP91C820A
(3) Starting AD conversion To start AD conversion, write a 1 to ADMOD0 in AD mode control register 0 or ADMOD1 in AD mode control register 1, and input falling edge on ADTRG pin. When AD conversion starts, the AD conversion busy flag ADMOD0 will be set to 1, indicating that AD conversion is in progress. Writing a 1 to ADMOD0 during AD conversion restarts conversion. At that time, to determine whether the AD conversion results have been preserved, check the value of the conversion data storage flag AD REGxL. During AD conversion, a falling edge input on the ADTRG pin will be ignored. (4) AD conversion modes and the AD conversion end interrupt The four AD conversion modes are: * * * * Channel fixed single conversion mode Channel scan single conversion mode Channel fixed repeat conversion mode Channel scan repeat conversion mode
The ADMOD0 and ADMOD0 settings in AD mode control register 0 determine the AD mode setting. Completion of AD conversion triggers an INTAD AD conversion end interrupt request. Also, ADMOD0 will be set to 1 to indicate that AD conversion has been completed. a. Channel fixed single conversion mode Setting ADMOD0 and ADMOD0 to 00 selects conversion channel fixed single conversion mode. In this mode data on one specified channel is converted once only. When the conversion has been completed, the ADMOD0 flag is set to 1, ADMOD0 is cleared to 0, and an INTAD interrupt request is generated. b. Channel scan single conversion mode Setting ADMOD0 and ADMOD0 to 01 selects conversion channel scan single conversion mode. In this mode data on the specified scan channels is converted once only. When scan conversion has been completed, ADMOD0 is set to 1, ADMOD0 is cleared to 0, and an INTAD interrupt request is generated.
91C820A-210
2006-01-31
TMP91C820A
c. Channel fixed repeat conversion mode Setting ADMOD0 and ADMOD0 to 10 selects conversion channel fixed repeat conversion mode. In this mode data on one specified channel is converted repeatedly. When conversion has been completed, ADMOD0 is set to 1 and ADMOD0 is not cleared to 0 but held at 1. INTAD interrupt request generation timing is determined by the setting of ADMOD0. Setting to 0 generates an interrupt request every time an AD conversion is completed. Setting to 1 generates an interrupt request on completion of every fourth conversion. d. Channel scan repeat conversion mode Setting ADMOD0 and ADMOD0 to 11 selects conversion channel scan repeat conversion mode. In this mode data on the specified scan channels is converted repeatedly. When each scan conversion has been completed, ADMOD0 is set to 1 and an INTAD interrupt request is generated. ADMOD0 is not cleared to 0 but held at 1. To stop conversion in a repeat conversion mode (e.g., in cases c and d), write a 0 to ADMOD0. After the current conversion has been completed, the repeat conversion mode terminates and ADMOD0 is cleared to 0. Switching to a halt state (IDLE2 mode with ADMOD1 cleared to 0, IDLE1 mode or STOP mode) immediately stops operation of the AD converter even when AD conversion is still in progress. In repeat conversion modes (e.g., in cases c and d), when the halt is released, conversion restarts from the beginning. In single conversion modes (e.g., in cases a and b), conversion does not restart when the halt is released (The converter remains stopped). Table 3.11.2 shows the relationship between the AD conversion modes and interrupt requests. Table 3.11.2 Relationship between AD Conversion Modes and Interrupt Requests Mode
Channel fixed single conversion mode Channel scan single conversion mode Channel fixed repeat conversion mode Channel scan repeat conversion mode
Interrupt Request Generation
After completion of conversion After completion of scan conversion Every conversion Every forth conversion After completion of every scan conversion
ADMOD0
X X 0 1 X

0 0 1 1

0 1 0 1
X: Don't care
91C820A-211
2006-01-31
TMP91C820A
(5) AD conversion time 84 states (4.7 s at fFPH = 36 MHz) are required for the AD conversion of one channel. (6) Storing and reading the results of AD conversion The AD conversion data upper and lower registers (ADREG04H/L to ADREG37H/L) store the results of AD conversion. (ADREG04H/L to ADREG37H/L are read-only registers.) In channel fixed repeat conversion mode, the conversion results are stored successively in registers ADREG04H/L to ADREG37H/L. In other modes the AN0 and AN4, AN1 and AN5, AN2 and AN6, and AN3 and AN7 conversion results are stored in ADREG04H/L, ADREG15H/L, ADREG26H/L and ADREG37H/L respectively. Table 3.11.3 shows the correspondence between the analog input channels and the registers, which are used to hold the results of AD conversion. Table 3.11.3 Correspondence between Analog Input Channels and AD Conversion Result Registers AD Conversion Result Register Analog Input Channel (Port 8)
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7
Conversion Modes Other than at Right
ADREG04H/L ADREG15H/L ADREG26H/L ADREG37H/L ADREG04H/L ADREG15H/L ADREG26H/L ADREG37H/L
Channel Fixed Repeat Conversion Mode (=1)
ADREG04H/L ADREG15H/L ADREG26H/L ADREG37H/L
bit0 of the AD conversion data lower register is used as the AD conversion data storage flag. The storage flag indicates whether the AD conversion result register has been read or not. When a conversion result is stored in the AD conversion result register, the flag is set to 1. When either of the AD conversion result registers (ADREGxH or ADREGxL) is read, the flag is cleared to 0. Reading the AD conversion result also clears the AD conversion end flag ADMOD0 to 0.
91C820A-212
2006-01-31
TMP91C820A
Setting example: a. Convert the analog input voltage on the AN3 pin and write the result, to memory address 1000H using the AD interrupt (INTAD) processing routine.
Main routine: INTE0AD ADMOD1 ADMOD0 765 X1 0 1 1 X XX0 4 0 X 0 3 - 0 0 2 - 0 0 1 - 1 0 0 - 1 1 Enable INTAD and set it to interrupt level 4. Set pin AN3 to be the analog input channel. Start conversion in channel fixed single conversion mode.
Interrupt routine processing example: WA WA (1000H) ADREG37 >>6 WA Read value of ADREG37L and ADREG37H into 16-bit general-purpose register WA. Shift contents read into WA six times to right and zero-fill upper bits. Write contents of WA to memory address 1000H.
b. This example repeatedly converts the analog input voltages on the three pins AN0, AN1 and AN2, using channel scan repeat conversion mode.
INTE0AD ADMOD1 ADMOD0 X0 0 0 - - - - 1 XXX0 0 1 0 XX0 0 0 1 1 1 Disable INTAD. Set pins AN0 to AN2 to be the analog input channels. Start conversion in channel scan repeat conversion mode.
X: Don't care, -: No change
91C820A-213
2006-01-31
TMP91C820A
3.12 Watchdog Timer (Runaway detection timer)
The TMP91C820A features a watchdog timer for detecting runaway. The watchdog timer (WDT) is used to return the CPU to normal state when it detects that the CPU has started to malfunction (Runaway) due to causes such as noise. When the watchdog timer detects a malfunction, it generates a non-maskable interrupt INTWD to notify the CPU of the malfunction. Connecting the watchdog timer output to the reset pin internally forces a reset. (The level of external RESET pin is not changed.)
3.12.1
Configuration
Figure 3.12.1 is a block diagram of he watchdog timer (WDT).
WDMOD
RESET
Reset control
Internal reset
WDTI interrupt
WDMOD 2 fSYS (fFPH/2)
15
Selector
2
17
219 2
21
Binary counter (22 Stage) Reset R
Q S
Internal reset Write 4EH Write B1H WDMOD
WDT control register WDCR
Internal data bus
Figure 3.12.1 Block Diagram of Watchdog Timer
Note:
The watchdog timer cannot operate by disturbance noise in some case. Take care when design the device.
91C820A-214
2006-01-31
TMP91C820A
The watchdog timer consists of a 22-stage binary counter which uses the system clock (fSYS) as the input clock. The binary counter can output fSYS/215, fSYS/217, fSYS/219 and fSYS/221.
WDT counter n Overflow 0
WDT interrupt Clear write code WDT clear (Soft ware)
Figure 3.12.2 Normal Mode The runaway is detected when an overflow occurs, and the watchdog timer can reset device. In this case, the reset time will be between 22 and 29 states (19.6 to 25.8 s at fFPH = 36MHz, fOSCH = 2.25 state) is fFPH/2, where fFPH is generated by dividing the high-speed oscillator clock (fOSCH) by sixteen through the clock gear function.
Overflow WDT counter n
WDT interrupt
Internal reset 22 to 29 states (19.6 to 25.8 s at fOSCH = 36 MHz, fFPH = 2.25 MHz)
Figure 3.12.3 Reset Mode
91C820A-215
2006-01-31
TMP91C820A 3.12.2 Control Registers
The watchdog timer WDT is controlled by two controls registers WDMOD and WDCR. (1) Watchdog timer mode register (WDMOD) a. Setting the detection time for the watchdog timer in This 2-bit register is used for setting the watchdog timer interrupt time used when detecting runaway. On a reset this register is initialized to WDMOD = 00. The detection times for WDT are shown in Figure 3.12.4. b. Watchdog timer enable/disable control register On a reset WDMOD is initialized to 1, enabling the watchdog timer. To disable the watchdog timer, it is necessary to set this bit to 0 and to write the disable code (B1H) to the watchdog timer control register (WDCR). This makes it difficult for the watchdog timer to be disabled by runaway. However, it is possible to return the watchdog timer from the disabled state to the enabled state merely by setting to 1. c. Watchdog timer out reset connection This register is used to connect the output of the watchdog timer with the RESET terminal internally. Since WDMODis initialized to 0 on a reset, a reset by the watchdog timer will not be performed. (2) Watchdog timer control register (WDCR) This register is used to disable and clear the binary counter for the watchdog timer. Disable control the watchdog timer can be disabled by clearing WDMOD to 0 and then writing the disable code (B1H) to the WDCR register.
WDMOD WDCR 0 - - - - - - 0 1 0 1 1 0 0 0 1 Clear WDMOD to 0. Write the disable code (B1H).
*
Enable control Set WDMOD to 1.
*
Watchdog timer clear control To clear the binary counter and cause counting to resume, write the clear code (4EH) to the WDCR register.
WDCR 0 1 0 0 1 1 1 0 Write the clear code (4EH).
Note1: If it is used disable control, set the disable code (B1H) to WDCR after write the clear code (4EH) once. (Please refer to setting example.) Note2: If it is changed Watchdog timer setting, change setting after set to disable condition once.
91C820A-216
2006-01-31
TMP91C820A
7
WDMOD (0300H) Bit symbol Read/Write After reset Function WDTE R/W 1 WDT control 1: Enable
6
WDTP1 R/W 0
5
WDTP0 0
4
3
2
I2WDT R/W 0 IDLE2 0: Stop 1: Operate
1
RESCR 0
0
- R/W 0
Select detecting time 15 00: 2 /fSYS 17 01: 2 /fSYS 19 10: 2 /fSYS 21 11: 2 /fSYS
1: Internally Always connects write "0". WDL out to the reset pin
Watchdog timer out control 0 1 - Connects WDT out to a reset
IDLE2 Control 0 1 Stop Operation
Watchdog timer detection time SYSCR1 System Clock Selection 1 (fs) SYSCR1 Gear Value XXX 000 (fc) 001 (fc/2) 0 (fc) 010 (fc/4) 011 (fc/8) 100 (fc/16)
at fc = 36 MHz, fs = 32.768 kHz Watchdog Timer Detection Time WDMOD 00 2.00 s 1.82 ms 3.64 ms 7.28 ms 14.56 ms 29.13 ms 01 8.00 s 7.28 ms 14.56 ms 29.13 ms 58.25 ms 116.51 ms 10 32.00 s 29.13 ms 58.25 ms 116.51 ms 233.02 ms 466.03 ms 11 128.00 s 116.51 ms 233.02 ms 466.03 ms 932.07 ms 1864.14 ms
Watchdog timer enable/disable control 0 1 Disabled Enabled
Figure 3.12.4 Watchdog Timer Mode Register
7
WDCR (0301H)
Prohibit readmodifywrite
6
5
4
- W -
3
2
1
0
Bit symbol Read/Write After reset Function B1H: WDT disable code 4EH: WDT clear code
Disable/clear WDT B1H 4EH Others Disable code Clear code Don't care
Figure 3.12.5 Watchdog Timer Control Register
91C820A-217
2006-01-31
TMP91C820A 3.12.3 Operation
The watchdog timer generates an INTWD interrupt when the detection time set in the WDMOD has elapsed. The watchdog timer must be 0 cleared in software before an INTWD interrupt will be generated. If the CPU malfunctions (e.g., if runaway occurs) due to causes such as noise, but does not execute the instruction used to clear the binary counter, the binary counter will overflow and an INTWD interrupt will be generated. The CPU will detect malfunction (Runaway) due to the INTWD interrupt and in this case it is possible to return to the CPU to normal operation by means of an anti-multifunction program. The watchdog timer does not operate in IDLE1 or STOP mode, as the binary counter continues counting during bus release (when BUSAK goes low). When the device is in IDLE2 mode, the operation of WDT depends on the WDMOD setting. Ensure that WDMOD is set before the device enters IDLE2 mode. Example: a. Clear the binary counter.
WDCR 0 1 0 0 1 1 1 0 Write the clear code (4EH).
b. Set the watchdog timer detection time to 217/fSYS.
WDMOD 1 0 1 - - - - 0
c. Disable the watchdog timer.
WDMOD 0 - - - - - - 0 WDCR 1 0 1 1 0 0 0 1 Clear WDTE to 0. Write the disable code (B1H).
91C820A-218
2006-01-31
TMP91C820A
3.13 Real Time Clock (RTC)
3.13.1 Function Description for RTC
1) 2) 3) 4) 5) 6) Clock function (Hour, minute, second) Calendar function (Month and day, day of the week, and leap year) 24- or 12-hour (AM/PM) clock function +/- 30 second adjustment function (by software) Alarm output 1Hz/16Hz (from ALARM pin) Interrupt generate by Alarm output 1Hz/16Hz
3.13.2
Block Diagram
16 Hz clock 32 kHz Clock: fs Divider 1 Hz clock
Alarm register Alarm select
ALARM ALARM
Carry hold (1 s)
INTRTC
Comparator
Clock
Address Bus Data bus Adjust Read/Write control
RD
WR
D0 to D7
Address
Figure 3.13.1 RTC Block Diagram
Note 1: The Christian era year column: This product has year column toward only lower two columns. Therefore the next year in 99 works as 00 years. In system to use it, please manage upper two columns with the system side when handle year column in the christian era. Note 2: Leap year: A leap year is the year, which is divisible with 4, but the year, which there is exception, and is divisible with 100, is not a leap year. However, the year is divisible with 400, is a leap year. But there is not this product for the correspondence to the above exception. Because there are only with the year which is divisible with 4 as a leap year, please cope with the system side if this function is problem.
91C820A-219
2006-01-31
TMP91C820A 3.13.3 Control Registers
Table 3.13.1 PAGE 0 (Clock function) Registers
Symbol
SECR MINR HOURR DAYR DATER MONTHR YEARR PAGER RESTR
Address
0320H 0321H 0322H 0323H 0324H 0325H 0326H 0327H 0328H
Bit7
Bit6
40 s 40 min.
Bit5
20 s 20 min. 20 /PM/AM
Bit4
10 s 10 min. 10 hours
Bit3
8s 8 min. 8 hours
Bit2
4s 4 min.
Bit1
2s 2 min.
Bit0
1s 1 min. 1 hour W0 Day 1 Jan. Year 1 PAGE setting
Function
Second column Minute column Hour column Day of the week column Day column Month column Year column
(Lower two columns)
Read/Write
R/W R/W R/W R/W R/W R/W R/W W, R/W Write only
4 hours 2 hours W2 W1 Day 2 Feb. Year 2
Day 20
Day 10 Oct.
Day 8 Aug. Year 8
Day 4 Apr. Year 4
Alarm enable
Year 80 Year 40 Year 20
Interrupt enable 1HZ enable 16HZ enable Clock reset
Year 10
Adjustment Clock function enable Alarm reset
PAGE register Reset register
Always write "0"
Note:
As for SECR, MINR, HOURR, DAYR, MONTHR, YEARR of PAGE0, current state is read when read it.
Table 3.13.2 PAGE 1 (Alarm function) Registers
Symbol
SECR MINR HOURR
Address
0320H 0321H 0322H
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
Function
Minute column for alarm Hour column for alarm Day of the week column for alarm Day column for alarm 24-hour clock mode
Read/Write
R/W
40 min.
20 min. 20 /PM/AM
10 min.
8 min.
4 min.
2 min.
1 min. 1 hour
R/W R/W
10 hours 8 hours 4 hours 2 hours
DAYR
0323H
W2
W1
W0
R/W
DATER MONTHR YEARR PAGER RESTR
0324H 0325H 0326H 0327H 0328H
Interrupt enable 1HZ enable 16HZ enable
Day 20
Day 10
Day 8
Day 4
Day 2
Day 1 24/12
R/W R/W R/W W, R/W Write only
Leap-year setting Leap-year mode
Clock enable Clock reset Alarm reset Alarm enable
PAGE setting
PAGE register Reset register
Always write "0"
Note2: As for SECR, MINR, HOURR, DAYR, MONTHR, YEARR of PAGE1, current state is read when read it
91C820A-220
2006-01-31
TMP91C820A 3.13.4 Detailed Explanation of Control Register
RTC is not initialized by reset. Therefore, all registers must be initialized at the beginning of the program. (1) Second column register (for PAGE0 only) 7
SECR (0320H) Bit symbol Read/Write After reset Function "0" is read. 40 sec. column 20 sec. column 10 sec. column
6
SE6
5
SE5
4
SE4
3
SE3 R/W Undefined 8 sec. column
2
SE2
1
SE1
0
SE0
4 sec. column
2 sec. column
1 sec. column
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 1 1 1 1 0 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0s 1s 2s 3s 4s 5s 6s 7s 8s 9s 10 s 19 s 20 s 29 s 30 s 39 s 40 s 49 s 50 s 59 s
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 Note: Do not set the data other than showing above.
91C820A-221
2006-01-31
TMP91C820A
(2) Minute column register (for PAGE0/1) 7
MINR (0321H) Bit symbol Read/Write After reset Function "0" is read. 40 min, column 20 min, column 10 min, column
6
MI6
5
MI5
4
MI4
3
MI3 R/W Undefined 8 min, column
2
MI2
1
MI1
0
MI0
4 min, column
2 min, column
1 min, column
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1
0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 1 1 1 1 0 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
0 min. 1 min. 2 min. 3 min. 4 min. 5 min. 6 min. 7 min. 8 min. 9 min. 10 min. 19 min. 20 min. 29 min. 30 min. 39 min. 40 min. 49 min. 50 min. 59 min.
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 0 0
:
1 0 Note: Do not set the data other than showing above.
91C820A-222
2006-01-31
TMP91C820A
(3) Hour column register (for PAGE0/1) a. In case of 24-hour clock mode (MONTHR = 1) 7
HOURR (0322H) Bit symbol Read/Write After reset Function "0" is read. 20 hour column 10 hour column 8 hour column
6
5
HO5
4
HO4
3
HO3 R/W Undefined
2
HO2
1
HO1
0
HO0
4 hour column
2 hour column
1 hour column
0 0 0 0 0 0 0 1 1
0 0 0 0 0 1 1 0 0
0 0 0
0 0 0
0 0 1 0 0 0 0 0 1
0 1 0 0 1 0 1 0 1
0 o'clock 1 o'clock 2 o'clock 8 o'clock 9 o'clock 10 o'clock 19 o'clock 20 o'clock 23 o'clock
:
1 1 0 0 0 0
:
1 0 0 0
:
0 0 Note: Do not set the data other than showing above.
b.
In case of 12-hour clock mode (MONTHR = 0) 7 6 5
HO5
4
HO4
3
HO3 R/W Undefined
2
HO2
1
HO1
0
HO0
HOURR (0322H)
Bit symbol Read/Write After reset Function "0" is read.
PM/AM
10 hour column
8 hour column
4 hour column
2 hour column
1 hour column
0 0 0 0 0 0 1 1
0 0 0 0 1 1 0 0
0 0 0 1 0 0 0 0
0 0 0 : 0 0 0 0 0
0 0 1 0 0 0 0 0
0 1 0 1 0 1 0 1
0 o'clock (AM) 1 o'clock 2 o'clock 9 o'clock 10 o'clock 11 o'clock 0 o'clock (PM) 1 o'clock
Note: Do not set the data other than showing above.
91C820A-223
2006-01-31
TMP91C820A
(4) Day of the week column register (for PAGE0/1) 7
DAYR (0323H) Bit symbol Read/Write After reset Function "0" is read. W2
6
5
4
3
2
WE2
1
WE1 R/W Undefined W1
0
WE0
W0
0 0 0 0 1 1 1
0 0 1 1 0 0 1
0 1 0 1 0 1 0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Note: Do not set the data other than showing above.
(5) Day column register (for PAGE0/1) 7
DATER (0324H) Bit symbol Read/Write After reset Function "0" is read. Day 20 0 0 0 0 0 0 0 0 0 1 1 1 1 Day 10 0 0 0 0 0 0 1 1 1 0 0 1 1 0 0 0 0 0 Day 8 0 0 0 0 1
6
5
DA5
4
DA4
3
DA3 R/W Undefined
2
DA2
1
DA1
0
DA0
Day 4 0 0 1 1 0 0 0 0 0 0 0 0 0
Day 2 0 1 0 1 0 1 0 1 1 0 1 0 1
Day 1 0 1st day 2nd day 3rd day 4th day 9th day 10th day 11th day 19th day 20th day 29th day 30th day 31st day
:
1 0 0 0 0 0
:
1 0 0 0
:
1 0 0 0 0 0
Note1: Do not set the data other than showing above. Note2: Do not set the day which is not existed. (ex: 30 Feb)
th
91C820A-224
2006-01-31
TMP91C820A
(6) Month column register (for PAGE0 only) 7
MONTHR (0325H) Bit symbol Read/Write After reset Function "0" is read. 10 months 8 months
6
5
4
MO4
3
MO4
2
MO2 R/W Undefined 4 months
1
MO1
0
MO0
2 months
1 month
0 0 0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 1 1 0 0 0
0 0 0 1 1 1 1 0 0 0 0 0
0 1 1 0 0 1 1 0 0 0 0 1
1 0 1 0 1 0 1 0 1 0 1 0
January February March April May June July August September October November December
Note: Do not set the data other than showing above.
(7) Select 24-hour clock or 12-hour clock (for PAGE1 only) 7
MONTHR (0325H) Bit symbol Read/Write After reset Function "0" is read.
6
5
4
3
2
1
0
MO0 R/W Undefined 1: 24-hour 0: 12-hour
91C820A-225
2006-01-31
TMP91C820A
(8) Year column register (for PAGE0 only) 7
YEARR (0326H) Bit symbol Read/Write After reset Function 80 Years 40 Years 20 Years 10 Years YE7
6
YE6
5
YE5
4
YE4 R/W Undefined
3
YE3
2
YE2
1
YE1
0
YE0
8 Years
4 Years
2 Years
1 Year
0 0 0 0 0 0 1
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 1
0 0 0 0 0 0 : 1
0 0 0 0 1 1 0
0 0 1 1 0 0 0
0 1 0 1 0 1 1
00 years 01 years 02 years 03 years 04 years 05 years 99 years
Note: Do not set the data other than showing above.
(9) Leap-year register (for PAGE1 only) 7
YEARR (0326H) Bit symbol Read/Write After reset Function
6
5
4
3
2
1
LEAP1 R/W Undefined 00: Leap-year
0
LEAP0
01: One year after leap year "0" is read. 10: Two years after leap year 11: Three years after leap year
0 0 1 1
0 1 0 1
Current year is leap year Present is next year of a leap year Present is two years after a leap year Present is three years after leap year
91C820A-226
2006-01-31
TMP91C820A
(10) Setting PAGE register (for PAGE0/1) 7
PAGER (0327H) Bit symbol Read/Write INTENA R/W 0
INTRTC 1: Enable 0: Disable
6
5
4
ADJUST W Undefined
0:Don't care Clock
3
ENATMR R/W Undefined
2
ENAALM
1
0
PAGE R/W Undefined
Read-modify After reset write Function instruction are prohibited Note:
ALARM 1: Enable 0: Disable
"0" is read.
"0" is read.
1:Adjust
1: Enable 0: Disable
PAGE selection
Pleas keep the setting order below and don't set same time. (Set difference time to Clock/Alarm setting and interrupt setting)
(Example) Clock setting/Alarm setting ld ld (pager), 0ch (pager), 8ch : : Clock, Alarm enable Interrupt enable 0 1 0 1 Select Page0 Select Page1 Don't care Adjust sec. counter. When set this bit to "1" the sec. counter become to "0" when the value of sec. counter is 0 - 29. And in case that value of sec. counter is 30-59, min. counter is carried and become sec. counter to "0". Output Adjust signal during 1 cycle of fSYS. After being adjusted once, Adjust is released automatically. (PAGE0 only)
PAGE
ADJUST
(11) Setting reset register (for PAGE0/1) 7
RESTR (1328H) Bit symbol Read/Write 1Hz 0: Enable 1: Disable 16Hz 0: Enable 1: Disable 0 1 Unused Reset alarm register 1: Clock reset 1:
Alarm reset
6
DIS16Hz
5
RSTTMR
4
RSTALM W Undefined
3
RE3
2
RE2
1
RE1
0
RE0
DIS1Hz
Read-modify After reset write Function instruction are prohibited
Always write "0"
RSTALM
Note: When write "1", reset alarm during 1 cycle of fSYS. After that, reset is released automatically. 0 1 Unused Reset divider
RSTTMR
Note: When write "1", reset alarm during 1 cycle of fSYS. After that, reset is released automatically. (PAGER) 1 0 0
1 0 1
1 1 0 Others
Source signal Alarm 1Hz 16Hz Output "0"
91C820A-227
2006-01-31
TMP91C820A 3.13.5 Operational Description
(1) Reading clock data There is the case, which reads wrong data when carry of the inside counter happens during the operation which clock data reads. Therefore please read two times with the following way for reading correct data.
Start
PAGER = "0", Select PAGE0
Read the clock data (1st)
Read the clock data (2nd)
1st data = 2nd data
No
Yes
End
Figure 3.13.2 Flowchart of Clock Data Read
91C820A-228
2006-01-31
TMP91C820A
(2) Timing of INTRTC and Clock data When time is read by interrupt, read clock data within 0.5s(s) after generating interrupt. This is because count up of clock data occurs by rising edge of 1Hz pulse cycle.
ALARM
INTRTC 1s counter (Internal signal) 56 57 58 59 0 1 2 3 4
1s count UP (Internal signal)
Figure 3.13.3 Timing of INTRTC and Clock data
91C820A-229
2006-01-31
TMP91C820A
(3) Writing clock data When there is carry on the way of write operation, expecting data can not be wrote exactly. Therefore, in order to write in data exactly please follow the below way. 1. Resetting a divider Inside of RTC, there is 15-stage divider which generates 1 Hz clock from 32.768 kHz. Carry of a clock is not done for 0.5 second when reset this divider. So write in data at this interval.
Start
PAGER = "0" Select PAGE0
RESTR = "1" Divider reset
Write the clock data
Note: This period is within 0.5 [s].
End
Figure 3.13.4 Flowchart of Data Write
91C820A-230
2006-01-31
TMP91C820A
2. Disabling the clock Carry of a clock is prohibited when write "0" to PAGER and can prevent malfunction by 1s carry hold circuit. During a clock prohibited, 1s carry hold circuit holds one second carry signal, which is generated from divider. After becoming clock enable state, output the carry signal to clock and revise time and continue operation. However, clock is late when clock-disabling state continues for one second or more.
Start
Disable the clock
Write the clock data
Enable the clock
End
Figure 3.13.5 Flowchart of Clock Disable
91C820A-231
2006-01-31
TMP91C820A 3.13.6 Explanation of the Alarm Function
Can use alarm function by setting of register of PAGE1 and output either of three signal from ALARM pin as follows by write "1" to PAGER. INTRTC outputs 1shot pulse when the falling edge is detected. RTC is not initializes by RESET. Therefore, when clock or alarm function is used, clear interrupt request flag in INTC (interrupt controller). (1) In accordance of alarm register and the clock, output "0". (2) Output clock of 1Hz. (3) Output clock of 16Hz.
(1) In accordance with alarm register and a clock, output "0" When value of a clock of PAGE0 accorded with alarm register of PAGE1 with a state of PAGER= "1", output "0" to ALARM pin and occur INTRTC. Follows are ways using alarm. Initialization of alarm is done by writing in "1" at RESTR, setting value of all alarm becomes don't care. In this case, always accorded with value of a clock and request INTRTC interrupt if PAGER is "1". Setting alarm min., alarm hour, alarm day and alarm the day week are done by writing in data at each register of PAGE1. When all setting contents accorded, RTC generates INTRTC interrupt, if PAGER is "1". However, contents (don't care state) which does not set it up is considered to always accord. The contents, which set it up once, cannot be returned to don't care state in independence. Initialization of alarm and resetting of alarm register set to "Don't care". The following is an example program for outputting alarm from ALARM -pin at noon (PM12:00) every day.
LD LD LD LD LD LD LD ( LD (PAGER), 09H (RESTR), D0H (DAYR), 01H (DATAR),01H (HOURR), 12H (MINR), 00H (PAGER), 0CH (PAGER), 8CH ; ; ; ; ; ; ; ; Alarm disable, setting PAGE1 Alarm initialize W0 1 day Setting 12 o'clock Setting 00 min Set up time 31 s (Note) Alarm enable Interrupt enable )
When CPU is operated by high frequency oscillation, it may take a maximum of one clock at 32 kHz (about 30s) for the time register setting to become valid. In the above example, it is necessary to set 31s of set up time between setting the time register and enabling the alarm register. Note: This set up time is unnecessary when you use only internal interruption.
91C820A-232
2006-01-31
TMP91C820A
(2) When output clock of 1Hz RTC outputs clock of 1Hz to ALARM pin by setting up PAGER= "0", RESTR= "0", = "1". And RTC generates INTRC interrupt by falling edge of the clock. (3) When output clock of 16Hz RTC outputs clock of 16Hz to ALARM pin by setting up PAGER= "0", RESTR= "1", = "0". And RTC generates INTRC interrupt by falling edge of the clock.
91C820A-233
2006-01-31
TMP91C820A
3.14 LCD Controller (LCDC)
The TMP91C820A incorporates two types liquid crystal display driving circuit for controlling LCD Driver LSI. * Shift-register type LCD driver control mode (SR type) Set the mode of operation, start address of display data save memory and LCD size to SFR before start SR type. After started SR type LCDC outputs bus release request to CPU and read data from display data memory. After that LCDC transmits data of volume of LCD size to external LCD driver through exclusive data bus (LD7:0). At this time, control signals connected LCD driver output specified waveform synchronizes with data transmission. After finish display data reading, LCDC cancels the bus release request and CPU will restart. As the display RAM, SDRAM burst mode can be used in TMP91C820A. * RAM built-in type LCD driver control mode (RAM mode) Data transmission to LCD driver is executed by move instruction of CPU. After setting mode of operation to SFR, when moves instruction of CPU is executed LCDC outputs chip select signal to LCD driver connected to the outside from control pin (D1BSCP etc.). Therefore control of data transmission numbers corresponding to LCD size is controlled by software. At this time, LCD controller output only chip enable signal, and transmission data output from data bus (D7:0). This section is constituted as follows. 3.14.1 Feature of LCDC of Each Mode 3.14.2 Block Diagram 3.14.3 SFR 3.14.4 Shift-Register Type LCD Driver Control Mode (SR type) 3.14.4.1 Operation 3.14.4.2 Gray Scale Mode Indication 3.14.4.3 Memory Mapping 3.14.4.4 Hardware Cursor 3.14.4.5 Frame Signal Settlement 3.14.4.6 Timing Charts of Interpreting Memory Codes 3.14.4.7 Interface Examples at SR Mode 3.14.4.8 Sample Program 3.14.5 RAM Built-in Type LCD Driver Control Mode (RAM type) 3.14.5.1 Operation 3.14.5.2 Interface Examples at Internal RAM Mode 3.14.5.3 Sample Program
91C820A-234
2006-01-31
TMP91C820A 3.14.1 Feature of LCDC of Each Mode
Each feature and operation of pin is as follows. Table 3.14.1 Feature of LCDC of Each Mode (Example: Toshiba made LCD driver T6C13B, T6B66A) Shift Register Type LCD Driver Control Mode
Common (Row): The number of picture elements can be handled Display memory data bus width LCD driver data bus width Transfer rate (at fFPH = 36 [MHz]) Data bus (D7 to D0) LCD data bus: (LD7 to LD0) Bus state 128, 160, 200, 240, 320, 400, 480
RAM Built-in Type LCD Driver Control Mode
There is not a limitation
Segment (Column): 128, 160, 240, 320, 400, 480, 560, 640 16-bit fixed 8-bit fixed Min 55 ns/1 word at SDRAM/BURST Min 111 ns/1 word at SRAM Not used Data bus; connect to data bus of LCD driver. Not used
Depend on the setting of CS/WAIT controller.
Data bus; connect to data bus of LCD driver. Not used Bus state; connect with write enable pin of segment/common driver. Address 0; connect with D/I pin of segment driver.
Address bus: (A0)
Not used
When A0 = 1 data bus value means display data, when A0 = 0 data bus means instruction data. Chip enable for segment driver 1; Connect with CE pin of segment driver 1.
External pins
Shift clock pulse: (D1BSCP) Latch pulse: (D2BLP) Frame: (D3BFR) Cascade pulse: (DLEBCD) Display off: ( DOFF )
Shift clock pulses; connect with SCP pin of segment driver. Driver latches data bus value by falling edge of this pin. Latch pulses output; connect with LP pin of segment/common driver. Display data is renewed in output register in LCD driver by rising edge of this pin. LCD frame output; connect with FR pin of segment/common driver. Cascade pulses output; connect with DIO1 pin of row driver. These pin outputs 1 shot pulse by every D3BFR pin changes.
Chip enable for segment driver 2; Connect with CE pin of segment driver 2. Chip enable for segment driver 3; Connect with CE pin of segment driver 3. Chip enable for common driver; Connect with LE pin of common driver.
Display off output; connect with DSPOF terminal of segment/common driver. L means display off and H means display on.
91C820A-235
2006-01-31
TMP91C820A 3.14.2 Block Diagram
Selector CPU address bus: A0 to A23 External data bus A0 to A23 External data bus D0 to D15 Clear Cursor control Gray scale Control
MMU
ROW Incrementor Internal data bus
COLUMN Incrementor
System clock: fSYS CPU BUSAK Output
InnerSCP Generator
COLUMN counter (9 bits) Incrementor (14bits)
COLUMN END RQ S SCPEN CPU BUSRQ Input
COLUMN register Internal data bus To internal INT (Rising edge) Lower rate clock: fs LCDCK TA3OUT EMCCR0 ROW register Internal data bus FP register
Comparator

Shift register Increment (14 bits)
LP generator
LP output circuit
External D2BLP
BCD generator
External DLEBCD
ROW Counter
DVM register FR generator
FR output driver
External D3BFR
FR driver LCD Exclusive Data bus LD0 to LD7 fSYS 2x, 4x, 8x clock divider 80-byte FIFO and SCP generator
External D1BSCP
Note: Row means common, and column means segment.
Figure 3.14.1 LCDC Block Diagram
91C820A-236
2006-01-31
TMP91C820A 3.14.3 SFR
LCD Mode Register 7
LCDMODE (04B0H) Bit symbol Read/Write After reset Function BAE R/W 0 Used by B AREA 0: Disable 1: Enable
6
AAE R/W 0 Used by A AREA 0: Disable 1: Enable
5
SCPW1 R/W 1 00: Base SCP 01: 2 clocks 10: 4 clocks 11: 8 clocks
4
SCPW0 R/W 0
3
- R/W 0 Always write "0".
2
BULK R/W 0 SDRAM BULK
1
RAMTYPE
0
MODE R/W 0 LCD driver type selection 0: RAM 1: SR
R/W 0 Display RAM
0: 64 Mbits 0: SRAM 1: 128 Mbits 1: SDRAM
Note 1: is effective only if 1 is set to . Note 2: SCPW [1:0] is introduced in section 3.14.4.6. Divide Frame Register 7
LCDDVM (04B1H) Bit symbol Read/Write After reset Function FMN7
6
FMN6
5
FMN5
4
FMN4 R/W 0
3
FMN3
2
FMN2
1
FMN1
0
FMN0
Setting Frame invert adjustment function bit7 to bit0
LCD Size Setting Register 7
LCDSIZE (04B2H) Bit symbol Read/Write After reset Function COM3 R/W 0 0000: 128 0001: 160 0010: 200 0011: 240 0100: 320 Other: Reserved
6
COM2 R/W 0
5
COM1 R/W 0 0101: 400 0110: 480
4
COM0 R/W 0
3
SEG3 R/W 0 0000: 128 0001: 160 0010: 240 0011: 320 0100: 400
2
SEG2 R/W 0
1
SEG1 R/W 0 0101: 480 0110: 560 0111: 640 Other: Reserved
0
SEG0 R/W 0
Setting the LCD common number for SR mode
Setting the LCD segment number for SR type
91C820A-237
2006-01-31
TMP91C820A
LCD Control Register 7
LCDCTL (04B3H) Bit symbol Read/Write After reset Function pin LCDON R/W 0
DOFF
6
ALL0 R/W 0
5
FRMON R/W 0 Divided FR mode 0: Disable 1: Enable
4
- R/W 0 Always write "0".
3
FP9 R/W 0
2
MMULCD R/W 0
1
FP8 R/W 0 Setting bit8 for fFP [9:0]
0
START R/W 0 Start control in SR type 0: STOP 1: START
Transfer data of exclusive bus for 0: Display LCD OFF 0: Normal 1: Display ON 1: All display data 0
Setting bit9 Specify for fFP [9:0] address of LCD driver with built-in RAM
0: Sequential 1: Random
LCDC start/stop bit
0
1
LCDC START LCDC STOP
Type select for internal RAM LCD driver
0
1
Sequential access type (No address pin in LCD driver) Random access type (Address pin in LCD driver)
Frame invert adjustment function
0
1
Disable Enable
All data of exclusive bus for LCD (LD7:0)
0
1
Normal All 0
Note:This bit forces sending data to LCD driver to 0 (Data off) by writing 1. Usually this bit is 0. LCD Driver pin DOFF
0
1
Driver OFF Driver ON
Note: This bit determines the status of DOFF pin 0: DOFF pin outputs 0 1: DOFF pin outputs 1
91C820A-238
2006-01-31
TMP91C820A
LCD fFP Register 7
LCDFFP (04B4H) Bit symbol Read/Write After reset Function FP7
6
FP6
5
FP5
4
FP4 R/W 0
3
FP3
2
FP2
1
FP1
0
FP0
Setting bit7 to bit0 for fFP
LCD Gray Level Setting Register 7
LCDGL (04B5H) Bit symbol Read/Write After reset Function 0 01: 4 levels 10: 8 levels 11: 16 levels
6
5
4
3
2
1
GRAY1 R/W
0
GRAY0 0
00: Monochrome
Table 3.14.2 LCD Start/End Address Register Start Address Register
H M L H
End Address Register
M L (bit7 to bit0) -
(bit23 to bit16) (bit15 to bit8) A-area After reset B-area After reset C-area After reset LSARAH (04C1H) 40H LSARBH (04C5H) 40H LSARCH (04CAH) 40H LSARAM (04C0H) 00H LSARBM (04C4H) 00H LSARCM (04C9H) 00H
(bit7 to bit0) (bit23 to bit16) (bit15 to bit8) - LEARAH (04C3H) 40H - LEARBH (04C7H) 40H LSARCL (04C8H) 00H - LEARAM (04C2H) 00H LEARBM (04C6H) 00H -
-
-
Note:
All registers are available for R (Read)/W (Write).
91C820A-239
2006-01-31
TMP91C820A
LCD Cursor Setting Register 7
LCDCM (04B6H) Bit symbol Read/Write After reset Function CDE R/W 0 Cursor 0: OFF 1: ON
6
CCS R/W 0 Cursor color 0: White 1: Black
5
4
3
2
1
CBE1 R/W 0
0
CBE0 R/W 0 (fs:32 kHz)
Cursor blink interval 00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz
Note 1: The function of cursor blink is effective only when low-frequency oscillator is input. Note 2: The function of cursor blink depends on the low-frequency oscillator (fs) even if you use timer out (TA3OUT) as LCDCK. LCD Cursor Width Setting Register 7
LCDCW (04B7H) Bit symbol Read/Write After reset Function
6
5
4
CW4 R/W 0
3
CW3 R/W 0
2
CW2 R/W 0 Cursor width 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CW1 R/W 0
0
CW0 R/W 0
LCD Cursor Height Setting Register 7
LCDCH (04B8H) Bit symbol Read/Write After reset Function
6
5
4
CH4 R/W 0
3
CH3 R/W 0
2
CH2 R/W 0 Cursor height 00000: 1 dot (Min) 11111: 32 dots (Max)
1
CH1 R/W 0
0
CH0 R/W 0
91C820A-240
2006-01-31
TMP91C820A
LCD Cursor Start Address Setting Register 7
LCDCPL (04BAH) Bit symbol Read/Write After reset Function CAP7 R/W 0
6
CAP6 R/W 0
5
CAP5 R/W 0
4
CAP4 R/W 0
3
CAP3 R/W 0
2
CAP2 R/W 0
1
CAP1 R/W 0
0
CAP0 R/W 0
Setting bit7 to bit0 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPM (04BBH) Bit symbol Read/Write After reset Function CAP15 R/W 0
6
CAP14 R/W 0
5
CAP13 R/W 0
4
CAP12 R/W 0
3
CAP11 R/W 0
2
CAP10 R/W 0
1
CAP9 R/W 0
0
CAP8 R/W 0
Setting bit15 to bit8 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPH (04BCH) Bit symbol Read/Write After reset Function CAP23 R/W 0
6
CAP22 R/W 1
5
CAP21 R/W 0
4
CAP20 R/W 0
3
CAP19 R/W 0
2
CAP18 R/W 0
1
CAP17 R/W 0
0
CAP16 R/W 0
Setting bit23 to bit16 for cursor start address
LCD Cursor Hot Point Pixel Number (Bit correction) Setting Register 7
LCDCP (04B9H) Bit symbol Read/Write After reset Function
6
5
4
3
APB3
2
APB2 R/W 0
1
APB1
0
APB0
Setting bit 3 to bit0 of pixel for correction of hot point (for 1-dot correction)
91C820A-241
2006-01-31
TMP91C820A
LCDC1L, LCDC1H, LCDC2L, LCDC2H, LCDC3L, LCDC3H, LCDR1L, LCDR1H Register 7
Bit symbol Read/Write After reset Function D7
6
D6
5
D5
4
D4
3
D3
2
D2
1
D1
0
D0
Depend on the specification of external LCD driver. Depend on the specification of external LCD driver. Depend on the specification of external LCD driver.
These registers do not exist on TMP91C820A. These are image for instruction registers and display registers of external RAM built-in sequential access type LCD driver. Address as Table 3.14.3 is assigned to these registers, and the following chip enable pin becomes active when accesses corresponding address. And, the area of these address is external area, so RD , WR terminal becomes active by external access. Table 3.14.4 shows the address map in the case of controlling RAM built-in random access type LCD driver. The explanation part of MMU circuit also explains this. This setup is performed by LCDCTL . Table 3.14.3 Memory Mapping for Built-in RAM Sequential Access Type Register
LCDC1L LCDC1H LCDC2L LCDC2H LCDC3L LCDC3H LCDR1L LCDR1H
Address
0FE0H 0FE1H 0FE2H 0FE3H 0FE4H 0FE5H 0FE6H 0FE7H
Purpose Sequential Access Type
RAM built-in type driver 1 RAM built-in type driver 2 RAM built-in type driver 3 ROW driver Instruction Display data Instruction Display data Instruction Display data Instruction Display data
Chip Enable A0 Terminal Terminal
D1BSCP D2BLP D3BFR DLEBCD 0 1 0 1 0 1 0 1
Table 3.14.4 Memory Mapping for Built-in RAM Random Access Type Address
3C0000H to 3CFFFFH 3D0000H to 3DFFFFH 3E0000H to 3EFFFFH 3F0000H to 3FFFFFH
Purpose Random Access Type
RAM built-in type driver 1 RAM built-in type driver 2 RAM built-in type driver 3 RAM built-in type driver 4
Chip Enable Terminal
D1BSCP D2BLP D3BFR DLEBCD
Note 1: We call built-in RAM sequential access type LCD driver that use register to access to display RAM without address. (e.g., T6B65A, T6C84 etc: mar/2000) Note 2: We call built-in RAM random access type LCD driver that is same method to access to SRAM. (e.g., T6C23, T6K01 etc: mar/2000)
91C820A-242
2006-01-31
TMP91C820A 3.14.4 Shift-Register Type LCD Driver Control Mode (SR type)
Set the mode of operation, start address of display data save memory, gray-scale level and LCD size to control registers before start SR type. After start it LCDC outputs bus release request to CPU and read data from display data memory. After that LCDC transmits data of volume of LCD size to external LCD driver through LCD personal data bus (LD7:0). At this time, control signals (D1BSCP etc.) connected LCD driver output specified waveform synchronizes with data transmission. After finish data transmission, LCDC cancels the bus release request and CPU will restart. LCD controller use LCDCK for generation waveform of D3BFR, DLEBCD and D2BLP pins. LCDCK select TAOUT that be outputted from low frequency oscillator (fs): 32.768kHz or internal TMRA23 by setting EMCCR0 register. is cleared to "0" by external reset, and low frequency oscillator (fs) is set. Note: When set LCDC to SR type, during data reading (during DMA operation), CPU is stopped by internal BUSREQ signal. When using SR type LCDC, programmer need to care the CPU stop time. For detail, see the Table 3.14.8.
3.14.4.1 Operation
91C820A-243
2006-01-31
TMP91C820A
3.14.4.2 Gray Scale Mode Indication Monochrome, 4-, 8- and 16-gray scale mode can be selected by setting LCDGL . And when SDRAM mode, you can select the size of SDRAM by setting (LCDMODE) . TMP91C820A realize gray scale display by thinning out the frame. Gray scale control palette is defined by 16-bit register (LGnL/H) shown in Table 3.14.5. Palette is selected according to the gray scale level (Monochrome, 4, 8, 16 gray) for use. (Ref. Table 3.14.6). On/off for data of each level (e.g., each density) can modify by 16-bit register (LGnL/H). However each resister of palette has an initial value, it is possible to adjust finely which matches to LCD driver you use and the characteristic of LCD panel. Table 3.14.5 Gray Scale Control Palette Default Setting t
D3BFR Level Code F E D C B A 9 8 7 6 5 4 3 2 1 0 Data Setting Register (Address/after reset) LGFH/L (04EF-E/FFFFH) LGEH/L (04ED-C/FDFDH) LGDH/L (04EB-A/FDDDH) LGCH/L (04E9-8/DDDDH) LGBH/L (04E7-6/DDD5H) LGAH/L (04E5-4/D5D5H) LG9H/L (04E3-2/D555H) LG8H/L (04E1-0/AAAAH) LG7H/L (04DF-E/8AAAH) LG6H/L (04DD-C/8A8AH) LG5H/L (04DB-A/888AH) LG4H/L (04D9-8/8888H) LG3H/L (04D7-6/8880H) LG2H/L (04D5-4/8080H) LG1H/L (04D3-2/8000H) LG0H/L (04D1-0/0000H)
Density 16/16 14/16 1316 12/16 11/16 10/16 9/16 8/16 7/16 6/16 5/16 4/16 3/16 2/16 1/16 0/16
bit0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
















: Display ON, : Display OFF Table 3.14.6 Gray Scale Control Palette Effective Registers for Each Gray Level
LG0 LG1 LG2 LG3 LG4 LG5 LG6 LG7 LG8 LG9 LGA LGB LGC LGD LGE LGE L/H 16-gray level 8-gray level 4-gray level Monochrome L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H L/H

x x
x
x x

x x
x
x x

x x
x
x x
x
x x
x x

x: Don't care, : Effective
91C820A-244
2006-01-31
TMP91C820A
3.14.4.3 Memory Mapping The LCDC can display the LCD panel image which is divided horizontally into 3 parts; upper, middle and lower. Each area calls A, B and C area that has some characteristics showing below. Start/end address of each area in the physical memory space can be defined in the LCD start/end address registers (See Table 3.14.2). (C area can be defined only start address.) A and B areas are selectable enable or not in LCDMODE register. When A and B area are disable, the C area take over all panel space. The displaying priority is A > B > C. If the A area set to enable while the panel area is defined as all C area (That is A and B area are disable), C area is shifted to under the LCD panel and A area is inserted from the top of the LCD panel. Similarly if the B area set to enable while the panel area is defined as all C area, B area is inserted from the bottom of the C area overlapping.
Memory Map Image Logic address 400000H Column address
Vertical pan
LCD Panel Image Reserved area for horizontal pan of C area
* Display data cannot input closely when
Ya
A area
X A area C area Ya
Row address
Yb
Vertical pan
B area
Yc C area
Vertical pan
Yc
Horizontal pan
B area Yb
Horizontal pan 600000H 2X
Figure 3.14.2 Memory Mapping from Physical Memory to LCD Panel
91C820A-245
2006-01-31
TMP91C820A
* Display memory mapping and panning function LCDC can change the panel window if only you change each start address of A and B area can be vertical panned by changing row address. While C area can be vertical and horizontal panned by changing row and column address. An important thing is that display data from one line to the next line, cannot be input continuously even if you don't use the panning function. One row address of display RAM corresponds to 1st line of display panel. Now display data of 2nd line cannot be set within the 1st row address of display RAM even if the necessary data for the size you want to display do not fill the capacity of 1st row address of display RAM. Adding the one line to display panel is equal to adding one address to row address of display RAM. And another important thing is, this limitation is also for SRAM as display RAM without address multiplex. When you use SDRAM as display RAM, you can select the size for display RAM capacity of one line. But in case of using SRAM, display RAM capacity of one line is fixed to 512 bytes.
16-bit bus width Display memory setting start address
Display panel of 1st line memory area
Memory area for display 1st line Reserved area (Display 1st line) (When using SRAM, this area is fixed to 512 bytes.)
Display panel of 2nd line memory area
Memory area for display 2nd line Reserved area (Display 2nd line) (When using SRAM, this area is fixed to 512 bytes.)
Display panel of 3rd line memory area
Memory area for display 3rd line Reserved area (Display 3rd line) (When using SRAM, this area is fixed to 512 bytes.)
Figure 3.14.3 Memory Mapping Image for SRAM as Display RAM (Only A and B area)
91C820A-246
2006-01-31
TMP91C820A
TMP91C820A can select four display scale; monochrome, 4 gray, 8 gray and 16 gray. With the intrinsic property of gray levels, a pixel is decoded in each gray level from different memory size. A pixel use a bit in memory for monochrome, while a pixel use 2 bits in memory for 4 gray, 3 bits for 8 gray and 4 bits for 16 gray. Sing bits of display memory has some differences for each gray scale or sort of memory. Monochrome (SRAM mode) Monochrome (SDRAM mode) 4 gray (SRAM/SDRAM) 8 gray (SRAM/SDRAM) 16 gray (SRAM/SDRAM)
px0 px1 px2 px3 px4 px5 px6 px7 px8 px9 px10 px11 px12 px13 px14 px15
px0 px1 px2 px3 px4 px5 px6 px7
px0
px1
px2
px3
px4
px5
px6
px7
px0
px1
px2
px3
px0
px1
px2
px3
Don't care
Figure 3.14.4 Gray display and using bit in memory
And "px" in above Figure 3.14.4 corresponds to the image of LCD panel as below (Figure 3.14.5). But TMP91C820A outputs data of px0 to PE7 (LD7), and data of px7 to PE0 (LD0). Therefore PE0 (LD0) should be connected to the MSB of LCD driver (e.g., DI7) according to LCD driver you use. Please note that the way TMP91C820A outputs the data differs from LCD controller built in TLCS-900/L1 series of TOSHIBA (e.g., TMP91C815, TMP91C016, TMP91C025 etc.).
LCD panel
px0 px1 px2 px3 px4 px5 px6 px7 px78 px9 px10 px11 px12 px13 px14 px15 px8
Segment driver LD7 LD6 LD5 LD4 LD3 LD2 LD1 LD0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
Figure 3.14.5 Connection between LCD Bus of TMP91C820A and Data Bus of LCDD
91C820A-247
2006-01-31
TMP91C820A
3.14.4.4 Hardware Cursor TMP91C820A has a cursor that is blinking interval, color and size can be specified, and maximum size is 32X32. A programmer can control the cursor attributes easily by filling those cursor registers, for example color (white/black), blinking interval time, size and intimate pixel location. Its space location is specified by left-up hot point. (See the Figure 3.14.6.) The precise location of the hot point is determined by memory address (LCDCPH, LCDCPM, LCDCPL) and pixel correction number (LCDCP). For example, however 1 pixel for displaying needs 2 bits of setting data under 4-gray mode, you can correct the location of hot point every pixel by setting pixel number which you want to move in the resister (LCDCP). Cursor image is showed under the setting A, B, C area are enable, 4-gray mode, start address = 410004_hex and correction bit (LCDCP) = 3_hex in the following figure. Memory map image Logic address
400000H A area Row address B area A area C area Cursor width
LCD panel image
C area 410000H
Correction pixel number : 3
Cursor height
Column address
Hot point
Cursor start address 410004H
B area
600000H
SDRAM size 128Mbit = 1 64Mbit = 0
A23 A22 A21 A20 A19 A18 A17 A16 A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
0 Row address Cursor start address Column address Ignore
Note: TMP91C820A sets the hardware cursor in the memory address. If panning function is set to enable during hardware cursor displaying, the cursor in the pannel moves, but start address of cursor is not changed.
Figure 3.14.6 Cursor Hot Point Position and Size, Cursor start address
91C820A-248
2006-01-31
TMP91C820A
LCD Cursor Setting Register 7
LCDCM (04B6H) Bit symbol Read/Write After reset Function CDE R/W 0 Cursor 0: OFF 1: ON
6
CCS R/W 0 Cursor color 0: White 1: Black
5
4
3
2
1
CBE1 R/W 0
0
CBE0 R/W 0 (fs: 32 kHz)
Cursor blink interval 00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz
Note 1: The function of cursor blink is effective only when low-frequency osdillator is input. Note 2: The function of cursor blink depends on the low-frequency oscillator (fs) even if you use timer out "TA3OUT" as LCDCK. LCD Cursor Width Setting Register 7
LCDCW (04B7H) Bit symbol Read/Write After reset Function
6
5
4
CW4 R/W 0 Cursor width
3
CW3 R/W 0
2
CW2 R/W 0
1
CW1 R/W 0
0
CW0 R/W 0
00000: 1 dot (MIN) 11111: 32 dots (MAX)
LCD Cursor Height Setting Register 7
LCDCH (04B8H) Bit symbol Read/Write After reset Function
6
5
4
CH4 R/W 0 Cursor height
3
CH3 R/W 0
2
CH2 R/W 0
1
CH1 R/W 0
0
CH0 R/W 0
00000: 1 dot (MIN) 11111: 32 dots (MAX)
LCD Cursor Start Address Setting Register 7
LCDCPL (04BAH) Bit symbol Read/Write After reset Function CAP7 R/W 0
6
CAP6 R/W 0
5
CAP5 R/W 0
4
CAP4 R/W 0
3
CAP3 R/W 0
2
CAP2 R/W 0
1
CAP1 R/W 0
0
CAP0 R/W 0
Setting bit7 to bit0 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPM (04BBH) Bit symbol Read/Write After reset Function CAP15 R/W 0
6
CAP14 R/W 0
5
CAP13 R/W 0
4
CAP12 R/W 0
3
CAP11 R/W 0
2
CAP10 R/W 0
1
CAP9 R/W 0
0
CAP8 R/W 0
Setting bit15 to bit8 for cursor start address
LCD Cursor Start Address Setting Register 7
LCDCPH (04BCH) Bit symbol Read/Write After reset Function CAP23 R/W 0
6
CAP22 R/W 1
5
CAP21 R/W 0
4
CAP20 R/W 0
3
CAP19 R/W 0
2
CAP18 R/W 0
1
CAP17 R/W 0
0
CAP16 R/W 0
Setting bit23 to bit16 for cursor start address
91C820A-249
2006-01-31
TMP91C820A
LCD Cursor Hot Point Pixel correction Setting Register 7
LCDCP (04B9H) Bit symbol Read/Write After reset Function
6
5
4
3
APB3
2
APB2 R/W 0
1
APB1
0
APB0
Setting bit3 to bit0 for correction of hot point (for 1-dot correction)
Table 3.14.7 Pixel correct and register setting
In case of monochrome (SRAM mode) In case of monochrome (SDRAM mode) and 4 gray (SRAM/SDRAM mode) In case of 8 gray and 16 gray (SRAN/SDRAM mode) 0000: 0 Pixel correct 0111: 7 Pixels correct 1111: 15 Pixels correct x000: 0 Pixel correct x001: 1 Pixel correct x010: 2 Pixels correct x011: 3 Pixels correct xx00: 0 Pixel correct xx01: 1 Pixel correct x100: 4 Pixels correct x101: 5 Pixels correct x110: 6 Pixels correct x111: 7 Pixels correct xx10: 2 Pixels correct xx11: 3 Pixels correct X: Don't care
Here, it is possible to correct the cursor per pixel from the start address set before. Pixel number should be adjusted in response to the gray mode setting showing above. For example, when 4-gray and 16-bit BUS mode, correction should be less than 7 pixels because the smallest pixel is 8 pixels that can set by start address setting. Similarly correction pixel should be less than 15 at monochrome mode, 3- at 8- or 16-gray mode. (e.g.) When monochrome mode, correction value is (LCDCP) = 011_hex, and cursor size = (8 x 8)
3-pixel move
Start address (LCDCPH/M/L) CURSOR Hot point
LCD panel
Figure 3.14.7 The Location Hot Point by Setting of Pixel
91C820A-250
2006-01-31
TMP91C820A
3.14.4.5 Frame Signal Settlement TMP91C820A defines so called frame period (Refresh interval for LCD panel) by the value set in fFP [9:0]. DLEBCD pin outputs pulse every frame period. DLEBFR pin usually outputs the signal inverts polarity every frame period. And TMP91C820A has a special function that can set the timing of inverting frame polarity irrelevant to above frame frequency for the purpose of preventing the patches of display. LCD Control Register 7
LCDCTL (04B3H) Bit symbol Read/Write After reset Function port 0: Display OFF 1: Display ON LCDON R/W 0
DOFF
6
ALL0 R/W 0 Setting all column ports to 0 0: Normal 1: All display data 0
5
FRMON R/W 0
4
-
3
FP9 R/W 0 Setting bit9 for fFP [9:0]
2
MMULCD R/W 0 Specify address of LCD driver with built-in RAM 0: OFF 1: ON
1
FP8 R/W 0 Setting bit8 for fFP [9:0]
0
START R/W 0 Start control in SR mode 0: Stop 1: Start
R/W 0
Divided FR Always mode write "0". 0: Disable 1: Enable
LCD fFP Register 7
LCDFFP (04B4H) Bit symbol Read/Write After reset Function FP7
6
FP6
5
FP5
4
FP4 R/W 0
3
FP3
2
FP2
1
FP1
0
FP0
Setting bit7 to bit0 for fFP
Divide FRM Register 7
LCDDVM (04B1H) Bit symbol Read/Write After reset Function FMN7
6
FMN6
5
FMN5
4
FMN4 R/W 0
3
FMN3
2
FMN2
1
FMN1
0
FMN0
Setting DVM bit7 to bit0
91C820A-251
2006-01-31
TMP91C820A
(1) Frame frequency setting Basic frame period; DLEBCD signal, is made according to the resister fFP [9:0] setting mentioned before. However this fFP [9:0] setting is generally equal to common number, frame period can be corrected by increasing fFP [9:0] with ease. This function cannot correct frame frequency higher than that of Table 3.14.8. If it is necessary to set frame frequency higher or detailed, please refer to (3) "Timer out LCDCK". The equation can calculate frame period. Frame period = LCDCK/(D x fFP) [Hz] D: Constant for each common (Table 3.14.8) fFP: Setting of fFP [9:0] register LCDCK: Source clock of LCD (Low clock is usually selected) Please select the value of fFP [9:0] as the frame period you want to set in the Table 3.14.7. Note: Please make the value set to fFP [9:0] into the following range. COM (common number) FR 1024
(e.g.) In the case where frame period is set to 72.10 Hz by 240 coms. fFP = 240 (COM) + 63 = 303 = 12FH (by Table 3.14.8) Therefore, LCDCTL = 1 and LCDFFP = 2FH are setup.
(2) Frame invert adjustment function This mode can prevent the deterioration of display (e.g., patches of display). (*Note) If N is set in (LCDDVM) register while this function is set to enable in register (LCDCTL) ( "1"), D3BFR pin outputs the signal inverted polarity every (D2BLP x N) timing. If this function isn't necessary, D3BFR pin outputs the signal inverted polarity every frequency of DLEBCD pin after setting this function disable ((LCDCTL) = 0). And it is no change wave and timing for DLEBCD pin by LCDDVM setting.
Note:
Effects of this function have some differences as the LCD driver or LCD panel you use actually.
91C820A-252
2006-01-31
TMP91C820A
(3) Timer out LCDCK LCD source clock (LCDCK) can select low frequency (fs: 32.768 [kHz]) or timer out (TA3OUT) outputs from internal TMRA23. (e.g.) Here indicates the method that frame period is set 70 [Hz] by selecting TA3OUT for source clock of LCD. (fc = 6 [MHz], 128 COM) Frame period = 1/(tLP x fFP) [Hz] tLP = D/XT XT = 128 x 3.5 x 70 = 26880 [Hz] XT should be above value. In order to make XT = 26880 [Hz] under fc = 6 [MHz] with T1 of timer 3, 1/XT = T3 x 2 x 8/fc [s] in short, XT = fc/(T3 x 2 x 8) [Hz] However T3 = (TA3REG) is 13.95 after calculate, it's impossible to set the value under a decimal point. So if T3 = (TA3REG) is set 0DH, XT = 28846 [Hz]. And because of D = 3, Frame period = 28846/(128 x 3) = 75.12 [Hz] Further if fFP is 136 (COM + 8) with correction, Frame period = 28846/(136 x 3) = 70.70 [Hz] Reference: To maintain quality for display, please refer to following value for each gray scale. (You have to use frame frequency setting, frame invert adjustment function and timer out LCDCK.) Monochrome: Frame period = 70 [Hz] 4 or 8 or 16 gray: Frame period = 140 [Hz] T3: The value of timer register (TA3REG) tLP: The period of D2BLP D: The value is 3 at 128 COM
The next equation calculates frame period. Source clock for LCDC defines as XT [Hz] and then this tLP represents Therefore if you set the frame period at 70 [Hz] under 128 COM,
91C820A-253
2006-01-31
TMP91C820A
Frame period = 78.02 Hz (at = 120) D3BFR DLEBCD
1 Display time for 1 picture (120 com) 2 3 120 1 2 3 1 2
D2BLP D1BSCP
2
120
3
1
2
3
LD7 to LD0
Data transmission (240 seg = 30 byte) of volume of 1 com
Figure 3.14.8 Timing Diagram for SR Mode
D3BFR DLEBCD D2BLP BUSRQ (Internal) D1BSCP LD7 to LD0
N N+1
N+28 N+29
tLP LP period tSTOP: Stop time
tOPR: CPU operating time
tLPH = 0.5XT
tSCP = 2 states
XT: 1/32768 [s] 1 state: 1/fSYS [s]
Figure 3.14.9 Timing Diagram for SR Mode (Detail) D3BFR waveform (in case of 240 row + 63 (FFP) and LCDDVM = 0B_hex)
D2BLP waveform LP1 LP2 LP3 LP10 LP11 LP301 LP302 LP303 LP304
D3BFR waveform
Divided frame disable
Divided frame enable
Figure 3.14.10 D2BLP and D3BFR Waveform
91C820A-254
2006-01-31
TMP91C820A
Table 3.14.8 fFP Table for Each Common Number (1/2) D
COM number COM + 0 COM + 1 COM + 2 COM + 3 COM + 4 COM + 5 COM + 6 COM + 7 COM + 8 COM + 9 COM + 10 COM + 11 COM + 12 COM + 13 COM + 14 COM + 15 COM + 16 COM + 17 COM + 18 COM + 19 COM + 20 COM + 21 COM + 22 COM + 23 COM + 24 COM + 25 COM + 26 COM + 27 COM + 28 COM + 29 COM + 30 COM + 31 COM + 32 COM + 33 COM + 34 COM + 35 COM + 36 COM + 37 COM + 38 COM + 39 COM + 40 COM + 41 COM + 42 COM + 43 COM + 44 COM + 45 COM + 46 COM + 47 COM + 48 COM + 49 COM + 50
6.5
64 78.77 77.56 76.38 75.24 74.14 73.06 72.02 71.00 70.02 69.06 68.12 67.22 66.33 65.48 64.63 63.81 63.02 62.24 61.48 60.74 60.01 59.31 58.62 57.95 57.29 56.64 56.01 55.40 54.80 54.21 53.63 53.07 52.51 51.97 51.44 50.92 50.41 49.91 49.42 48.94 48.47 48.01 47.56 47.11 46.68 46.25 45.83 45.42 45.01 44.61 44.22
6.0
68 80.31 79.15 78.02 76.92 75.85 74.81 73.80 72.82 71.86 70.93 70.02 69.13 68.27 67.42 66.60 65.80 65.02 64.25 63.50 62.77 62.06 61.36 60.68 60.01 59.36 58.72 58.10 57.49 56.89 56.30 55.73 55.16 54.61 54.07 53.54 53.02 52.51 52.01 51.52 51.04 50.57 50.10 49.65 49.20 48.76 48.33 47.91 47.49 47.08 46.68 46.28
5.0
80 81.92 80.91 79.92 78.96 78.02 77.10 76.20 75.33 74.47 73.64 72.82 72.02 71.23 70.47 69.72 68.99 68.27 67.56 66.87 66.20 65.54 64.89 64.25 63.63 63.02 62.42 61.83 61.25 60.68 60.12 59.58 59.04 58.51 58.00 57.49 56.99 56.50 56.01 55.54 55.17 54.61 54.16 53.72 53.28 52.85 52.43 52.01 51.60 51.20 50.80 50.41
4.0
100 81.92 81.11 80.31 79.53 78.77 78.02 77.28 76.56 75.85 75.16 74.47 73.80 73.14 72.50 71.86 71.23 70.62 70.02 69.42 68.84 68.27 67.70 67.15 66.60 66.06 65.54 65.02 64.50 64.00 63.50 63.02 62.53 62.06 61.59 61.13 60.68 60.24 59.80 59.36 58.94 58.51 58.10 57.69 57.29 56.89 56.50 56.11 55.73 55.35 54.98 54.61
3.5
120 78.02 77.37 76.74 76.12 75.50 74.90 74.30 73.72 73.14 72.58 72.02 71.47 70.93 70.39 69.87 69.35 68.84 68.34 67.84 67.35 66.87 66.40 65.93 65.47 65.02 64.57 64.13 63.69 63.26 62.83 62.42 62.00 61.59 61.19 60.79 60.40 60.01 59.63 59.25 58.88 58.51 58.15 57.79 57.44 57.09 56.74 56.40 56.06 55.73 55.40 55.07
3.0
128 85.33 84.67 84.02 83.38 82.75 82.13 81.51 80.91 80.31 79.73 79.15 78.58 78.02 77.47 76.92 76.38 75.85 75.33 74.81 74.30 73.80 73.31 72.82 72.34 71.86 71.39 70.93 70.47 70.02 69.57 69.13 68.70 68.27 67.84 67.42 67.01 66.60 66.20 65.80 65.41 65.02 64.63 64.25 63.88 63.50 63.14 62.77 62.42 62.06 61.71 61.36
2.5
144 91.02 90.39 89.78 89.16 88.56 87.97 87.38 86.80 86.23 85.67 85.11 84.56 8.02 83.49 82.96 81.92 81.41 80.91 80.41 79.92 79.44 78.96 78.49 78.02 77.56 77.10 76.65 76.20 75.76 75.33 74.91 74.47 74.05 73.64 73.22 72.82 72.42 72.02 71.62 71.23 70.85 70.47 70.09 69.72 69.35 68.99 68.62 68.27 67.91 67.56
2.5
160 81.92 81.41 80.91 80.41 79.92 79.44 78.96 78.49 78.02 77.56 77.10 76.65 76.20 75.76 75.33 74.90 74.47 74.05 73.64 73.22 72.82 72.42 72.02 71.62 71.23 70.85 70.47 70.09 69.72 69.35 68.99 68.62 68.27 67.91 67.56 67.22 66.87 66.53 66.20 65.87 65.54 65.21 64.89 64.57 64.25 63.94 63.63 63.32 63.02 62.71 62.42
2.0
200 81.92 81.51 81.11 80.71 80.31 79.92 79.53 79.15 78.77 78.39 78.02 77.65 77.28 76.92 76.56 76.20 75.85 75.50 75.16 74.81 74.47 74.14 73.80 73.47 73.14 72.82 72.50 72.18 71.86 71.55 71.23 70.93 70.62 70.32 70.02 69.72 69.42 69.13 68.84 68.55 68.27 67.98 67.70 67.42 67.15 66.87 66.60 66.33 66.06 65.80 65.54
1.5
240 91.02 90.64 90.27 89.90 89.53 89.16 88.80 88.44 88.09 87.73 87.38 87.03 86.69 86.35 86.01 85.67 85.33 85.00 84.67 84.34 84.02 83.70 83.38 83.06 82.75 82.44 82.13 81.82 81.51 81.21 80.91 80.61 80.31 80.02 79.73 79.44 79.15 78.86 78.58 78.30 78.02 77.74 77.47 77.19 76.92 76.65 76.38 76.12 75.85 75.59 75.33
Unit
Hz
91C820A-255
2006-01-31
TMP91C820A
Table 3.14.9 fFP Table for Each Common Number (2/2) D
COM number COM + 51 COM + 52 COM + 53 COM + 54 COM + 55 COM + 56 COM + 57 COM + 58 COM + 59 COM + 60 COM + 61 COM + 62 COM + 63 COM + 64 COM + 65 COM + 66 COM + 67 COM + 68 COM + 69 COM + 70 COM + 71 COM + 72 COM + 73 COM + 74 COM + 75 COM + 76 COM + 77 COM + 78 COM + 79 COM + 80
6.5
64 43.84 43.46 43.09 42.72 42.36 42.01 41.66 41.32 40.99 40.66 40.33 40.01 39.69 39.38 39.08 38.78 38.48 38.19 37.90 37.62 37.34 37.07 36.80 36.53 36.27 36.01 35.75 35.50 35.25 35.01
6.0
68 45.89 45.51 45.13 44.77 44.40 44.04 43.69 43.34 43.00 42.67 42.34 42.01 41.69 41.37 41.06 40.76 40.45 40.16 39.86 39.57 39.29 39.01 38.73 38.46 38.19 37.93 37.66 37.41 37.15 36.90
5.0
80 50.03 49.65 49.28 48.91 48.55 48.19 47.84 47.49 47.15 46.81 46.48 46.15 45.83 45.51 45.20 44.89 44.58 44.28 43.98 43.69 43.40 43.12 42.83 42.56 42.28 42.01 41.74 41.48 41.22 40.96
4.0
100 54.25 53.89 53.54 53.19 52.85 52.51 52.18 51.85 51.52 51.20 50.88 50.57 50.26 49.95 49.65 49.35 49.05 48.76 48.47 48.19 47.91 47.63 47.35 47.08 46.81 46.55 46.28 46.02 45.77 45.51
3.5
120 54.75 54.43 54.12 53.81 53.50 53.19 52.89 52.60 52.30 52.01 51.73 51.44 51.16 50.88 50.61 50.33 50.07 49.80 49.54 48.28 49.02 48.76 48.51 48.26 48.01 47.77 47.52 47.28 47.05 46.81
3.0
128 61.02 60.68 60.35 60.01 59.69 59.36 59.04 58.72 58.41 58.10 57.79 57.49 57.19 56.89 56.59 56.30 56.01 55.73 55.45 55.16 54.89 54.61 54.34 54.07 53.81 53.54 53.28 53.02 52.77 52.51
2.5
144 67.22 66.87 66.53 66.20 65.87 65.54 65.21 64.89 64.57 64.25 63.94 63.63 63.32 63.02 62.71 62.42 62.12 61.83 61.54 61.25 60.96 60.68 60.40 60.12 59.85 59.58 59.31 59.04 58.75 58.51
2.5
160 62.12 61.83 61.54 61.25 60.96 60.68 60.40 60.12 59.85 59.58 59.31 59.04 58.78 58.51 58.25 58.00 57.74 57.49 57.24 56.99 56.74 56.50 56.25 56.01 55.78 55.54 55.30 55.07 54.84 54.61
2.0
200 62.27 65.02 64.76 64.50 64.25 64.00 63.75 63.50 63.26 63.02 62.77 62.53 62.30 62.06 61.83 61.59 61.36 61.13 60.91 60.68 60.46 60.24 60.01 59.80 59.58 59.36 59.15 58.94 58.72 58.51
1.5
240 75.07 74.81 74.56 74.30 74.05 73.80 73.55 73.31 73.06 72.82 72.58 72.34 72.10 71.86 71.62 71.39 71.16 70.93 70.70 70.47 70.24 70.02 69.79 69.57 69.35 69.13 68.91 68.70 68.48 68.27
Unit
Hz
Note: Above value is at fs = 32.768 [kHz].
91C820A-256
2006-01-31
TMP91C820A
Table 3.14.10 Performance Listing for Each Segment and Common Number
64-Mbit SDRAM mode 4 GRAY com D tLP Seg 128 160 240 320 400 480 560 640 tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate 1.22 1.33 1.44 1.58 2.00 2.18 2.56 2.79 3.11 3.40 3.67 4.00 4.22 4.61 4.78 5.22 1.22 1.60 1.44 1.89 2.00 2.62 2.56 3.35 3.11 4.08 3.67 4.81 4.22 5.53 4.78 6.26 1.22 2.00 1.44 2.37 2.00 3.28 2.56 4.19 3.11 5.10 3.67 6.01 4.22 6.92 4.78 7.83 1.22 2.67 1.44 3.16 2.00 4.37 2.56 5.58 3.11 6.80 3.67 8.01 4.22 9.22 4.78 10.44 1.22 2.67 1.44 3.16 2.00 4.37 2.56 5.58 3.11 6.80 3.67 8.01 4.22 9.22 4.78 10.44 1.22 4.00 1.44 4.73 2.00 6.55 2.56 8.37 3.11 10.19 3.67 12.01 4.22 13.84 4.78 15.66 1.22 4.00 1.44 4.73 2.00 6.55 2.56 8.37 3.11 10.19 3.67 12.01 4.22 13.84 4.78 15.66
s
128 3 91.6
160 3 76.3
200 2 61.0
240 2 45.8
320 2 45.8
400 1 30.5
480 1 30.5 Unit
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
64-Mbit SDRAM mode 8 GRAY /16 GRAY com D TLP seg 128 160 240 320 400 480 560 640 tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate 2.11 2.31 2.56 2.79 3.67 4.00 4.78 5.22 5.89 6.43 7.00 7.65 8.11 8.86 9.22 10.07 2.11 2.77 2.56 3.35 3.67 4.81 4.78 6.26 5.89 7.72 7.00 9.18 8.11 10.63 9.22 12.09 2.11 3.46 2.56 4.19 3.67 6.01 4.78 7.83 5.89 9.65 7.00 11.47 8.11 13.29 9.22 15.11 2.11 4.61 2.56 5.58 3.67 8.01 4.78 10.44 5.89 12.86 7.00 15.29 8.11 17.72 9.22 20.15 2.11 4.61 2.56 5.58 3.67 8.01 4.78 10.44 5.89 12.86 7.00 15.29 8.11 17.72 9.22 20.15 2.11 6.92 2.56 8.37 3.67 12.01 4.78 15.66 5.89 19.30 7.00 22.94 8.11 26.58 9.22 30.22 2.11 6.92 2.56 8.37 3.67 12.01 4.78 15.66 5.89 19.30 7.00 22.94 8.11 26.58 9.22 30.22
s
128 3 91.6
160 3 76.3
200 2 61.0
240 2 45.8
320 2 45.8
400 1 30.5
480 1 30.5 Unit
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
91C820A-257
2006-01-31
TMP91C820A
SRAM MONOCHROME com D TLP seg 128 160 240 320 400 480 560 640 tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate SRAM 4 GRAY com D TLP seg 128 160 240 320 400 480 560 640 tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate 1.78 1.94 2.22 2.43 3.33 3.64 4.44 4.85 5.56 6.07 6.67 7.28 7.78 8.50 8.89 9.71 1.78 2.33 2.22 2.91 3.33 4.37 4.44 5.83 5.56 7.28 6.67 8.74 7.78 10.19 8.89 11.65 1.78 2.91 2.22 3.64 3.33 5.46 4.44 7.28 5.56 9.10 6.67 10.92 7.78 12.74 8.89 14.56 1.78 3.88 2.22 4.85 3.33 7.28 4.44 9.71 5.56 12.14 6.67 14.56 7.78 16.99 8.89 19.42 1.78 3.88 2.22 4.85 3.33 7.28 4.44 9.71 5.56 12.14 6.67 14.56 7.78 16.99 8.89 19.42 1.78 5.83 2.22 7.28 3.33 10.92 4.44 14.56 5.56 18.20 6.67 21.85 7.78 25.49 8.89 29.13 1.78 5.83 2.22 7.28 3.33 10.92 4.44 14.56 5.56 18.20 6.67 21.85 7.78 25.49 8.89 29.13
s
128 3 91.6 0.89 0.97 1.11 1.21 1.67 1.82 2.22 2.43 2.78 3.03 3.33 3.64 3.89 4.25 4.44 4.85
160 3 76.3 0.89 1.17 1.11 1.46 1.67 2.18 2.22 2.91 2.78 3.64 3.33 4.37 3.89 5.10 4.44 5.83
200 2 61.0 0.89 1.46 1.11 1.82 1.67 2.73 2.22 3.64 2.78 4.55 3.33 5.46 3.89 6.37 4.44 7.28
240 2 45.8 0.89 1.94 1.11 2.43 1.67 3.64 2.22 4.85 2.78 6.07 3.33 7.28 3.89 8.50 4.44 9.71
320 2 45.8 0.89 1.94 1.11 2.43 1.67 3.64 2.22 4.85 2.78 6.07 3.33 7.28 3.89 8.50 4.44 9.71
400 1 30.5 0.89 2.91 1.11 3.64 1.67 5.46 2.22 7.28 2.78 9.10 3.33 10.92 3.89 12.74 4.44 14.56
480 1 30.5 0.89 2.91 1.11 3.64 1.67 5.46 2.22 7.28 2.78 9.10 3.33 10.92 3.89 12.74 4.44 14.56 Unit
s s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
128 3 91.6
160 3 76.3
200 2 61.0
240 2 45.8
320 2 45.8
400 1 30.5
480 1 30.5 Unit
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
91C820A-258
2006-01-31
TMP91C820A
SRAM 8 GRAY/16 GRAY com D TLP seg 128 160 240 320 400 480 560 640 tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate tSTOP CPU stop rate 3.56 3.88 4.44 4.85 6.67 7.28 8.89 9.71 11.11 12.14 13.33 14.56 15.56 16.99 17.78 19.42 3.56 4.66 4.44 5.83 6.67 8.74 8.89 11.65 11.11 14.56 13.33 17.48 15.56 20.39 17.78 23.30 3.56 5.83 4.44 7.28 6.67 10.92 8.89 14.56 11.11 18.20 13.33 21.85 15.56 25.49 17.78 29.13 3.56 7.77 4.44 9.71 6.67 14.56 8.89 19.42 11.11 24.27 13.33 29.13 15.56 33.98 17.78 38.84 3.56 7.77 4.44 9.71 6.67 14.56 8.89 19.42 11.11 24.27 13.33 29.13 15.56 33.98 17.78 38.84 3.56 11.65 4.44 14.56 6.67 21.85 8.89 29.13 11.11 36.41 13.33 43.69 15.56 50.97 17.78 58.25 over 50% 3.56 11.65 4.44 14.56 6.67 21.85 8.89 29.13 11.11 36.41 13.33 43.69 15.56 50.97 17.78 58.25
s
128 3 91.6
160 3 76.3
200 2 61.0
240 2 45.8
320 2 45.8
400 1 30.5
480 1 30.5 Unit
s
%
s
%
s
%
s
%
s
%
s
%
s
%
s
%
91C820A-259
2006-01-31
TMP91C820A
Note 1: The value of the Table 3.14.8 is at fC = 36 [MHz]. Note 2: Bus occupation time to CPU; tSTOP (in the Figure 3.14.11) is the time which CPU reads the memory of transferring with 0 waits. Note 3: The following equation can calculate tLP listed below. tLP = D/32768 [s] (e.g.) If the row is 240 and D = 1.5 by the above table tLP = 1.5/32768 = 45.8 [s]
D3BFR pin DLEBCD pin D2BLP pin D1BSCP pin D7 to D0 pin
tLP
1
2
3
120
1
2
3
120
1
2
BUS occupation time of CPU tSTOP
* BUS occupation rate of CPU = tSTOP/tLP
Figure 3.14.11 Bus occupation time to CPU and BUS Occupation Rate of CPU
91C820A-260
2006-01-31
TMP91C820A
3.14.4.6 Timing Charts of Interpreting Memory Codes TMP91C820A supports different memory accessing. They are SRAM with waits, SDRAM burst modes, and the size of SDRAM is 16M/64M/128Mbits. The access signals for the LCD panel are shown in Figure 3.14.12. To catch low speed LCD drivers, 3 types of SCP rates (fSYS/2, fSYS/4, and fSYS/8) can be selected. The output data (LD7 to LD0) will be issued from the built-in FIFO at the rising edge of D1BSCP when the FIFO is no empty. The work of the FIFO is illustrated in Figure 3.14.13, where the buffer size 80 bytes. The FIFO latches BaseLD7 to LD0 signal at the falling edge of BaseSCP which is shown in Figure 3.14.14 and 3.14.15 for SRAM and SDRAM modes respectively. The FIFO is always reset to the empty state by the rising edge of D2BLP. In BaseSCP mode (e.g., for SCPW1, 0 = 00), D1BCP is equal to BaseSCP, LD7 to LD0 equal to BaseLD7 to LD0 and no FIFO used. Generally, the data input rate of FIFO should be greater than the output one. To make FIFO work correctly, the following condition have to be satisfied by setting SFR properly. (N/8 + 1) x tcw + 24 x 1/fC < tLP - tLPH Here, N is the segment number, and tcw is D1BSCP clock cycle, tLP is D2BLP cycle, and tLPH is High width of D2BLP signal. Referring Figure 3.14.16, we can know this relation means that the last LD7 to LD0 data must be generated before the rising edge of D2BLP. For example, in case of fC = 36 MHz, fS = 32 kHz, 4 gray, 240 com, 640 seg, and SDRAM burst mode, the following table can be obtained, which tells user that 8 clock mode is impossible and SCPW = base/2/4 clock modes can be used. D1BSCP frequency (MHz)
18 9 4.5 2.25
SCPW
Base 2 clk 4 clk 8 clk
tcw (ns)
55.6 111.2 222.4 444.8
(N/8+1) x tcw + T_busdly tLP - tLPH (ns) Judgment + T_busfmax (ns)
5166.1 9674.4 18681.6 36696 31250 31250 31250 31250 OK OK OK ERROR
Note: The speed of BaseSCP mode is equal to 2clk mode in the 8 or 16 GRAY mode.
fSYS D1BSCP LD7 to LD0 D1BSCP SCP 4 clocks LD7 to LD0 OUT-1 OUT OUT+1 OUT-1 OUT OUT+1 OUT+2 OUT+3 OUT+4 SCP 2 clocks
D1BSCP SCP 8 clocks LD7 to LD0 OUT-1 OUT
Figure 3.14.12 Timing Diagram for the LCD Panel Access Signals
91C820A-261
2006-01-31
TMP91C820A
BaseSCP
OUT OUT+1
BaseLD7 to LD0
80 bytes FIFO
OUT
OUT+1
LD7 to LD0
fSYS
fSYS/2, fSYS/4, fSYS/8
D1BSCP
D2BLP Note: D1BSCP = BaseSCP and BaseLD7 to LD0 = BaseLD7 to LD0 in BaseSCP mode (e.g., for SCPW [1:0] = 00)
Figure 3.14.13 Timing Diagram for FIFO
91C820A-262
2006-01-31
TMP91C820A
Internal system clock (fSYS) SRAM 0 WAIT mode A23 to A0
RD
N IN
N+1 IN+1
N+2 IN+2
N+3 IN+3
2 states
N+4 IN+4
N+5 IN+5
D15 to D0
BaseSCP Monochrome BaseLD7 to LD0 BaseSCP Base SCP 4 gray BaseLD7 to LD0 BaseSCP 8 or 16 gray BaseLD7 to LD0 OUT-1 OUT OUT+1
OUT-1 OUT OUT+1 OUT+2 OUT+3 OUT+4
OUT-1 OUT-1 OUT OUT OUT+1 OUT+1 OUT+2 OUT+2 OUT+3 OUT+3 OUT+4 OUT+4
Figure 3.14.14 Timing Diagram for SRAM Mode with BaseSCP
fSYS SDRAM BURST mode A23 to A0
RD
227 Row
Column
D15 to D0
I IN
IN+1
IN+2
IN+3
IN+4
IN+5
IN+6
IN+7
BaseSCP Monochrome BaseLD7 to LD0 BaseSCP
Base SCP
OUT OUT+1 OUT+2 OUT+3 OUT+4 OUT+5 OUT+6
4 gray BaseLD7 to LD0 BaseSCP BaseLD7 to LD0
OUT OUT+1 OUT+2
OUT OUT+1 OUT+2 OUT+3 OUT+4 OUT+5 OUT+6
8 or 16 gray
Figure 3.14.15 Timing Diagram for SDRAM BURST Mode with BaseSCP
91C820A-263
2006-01-31
TMP91C820A
SDRAM BURST 1-clock mode
fSYS A23 to A0
RD
227 Row
Column
D15 to D0
IN
IN+1
IN+2
IN+3
IN+4
IN+5
IN+6
IN+7
BaseSCP Monochrome BaseLD7 to LD0
OUT OUT OUT+1 OUT+1 OUT+2 OUT+2 OUT+3
tcw D1BSCP
LD7 to LD0
T_bufmax
OUT
OUT
OUT+1
D2BLP
T_busdly
(SegNum/8) x tcw + T_bufdly
tLPH
tLP Note 1: If Base SCP, T_bufmax = 0. Note 2: If except Base, T_bufmax tcw + 2/fc Note 3: T_busdly is about 11 times as long as fSYS period (22/fc).
Figure 3.14.16 Timing Diagram for Maximum FIFO Delay Time
91C820A-264
2006-01-31
TMP91C820A
3.14.4.7 Interface Examples at SR Mode
TMP91C820A
VDD
T6C13B (240-row driver selection)
VDD VSS DIR TEST Di7 to Di0 DUAL SCP S/C VCCL/R, V0L/R, V1L/R, V4L/R, V5L/R DSPOF FR LP EIO2 EIO1
O001
COM001
VSS
240COM x 240SEG LCD
SEG001 SEG240 Power supply circuit VCCLR, V0LR, V2LR, VSSLR, V3LR, V5LR VSS TEST DUAL O240
Power supply circuit
O240
COM240
DLEBCD D1BSCP D2BLP D3BFR DOFF LD0 to LD7
Open
Control signal D0 to D15 A0 to A23 VSS VDD VSS
Display memory (SDRAM/SRAM selection)
Note 1: Note 2:
Display memory should be 16-bit bus. Other circuit is necessary for LCD drive power supply for LCD driver display.
Figure 3.14.17 Interface Example for Shift Register Type LCD Driver Note: Because the connection between the line of display RAM data and output bus: LD0:7 is just the mirror reverse, please care of connection. The data LSB of display RAM is output from LD7. In the above figure, LD0 shoud be connected to DI7 of LCD driver, and LD1 to DI6. For detail information, please refer to Figure 3.14.5.
Axx to Axx D0 to D15 Control signal
T6C13B (240-column driver selection)
DIR VDD S/C
Open
SCP LP FR DSPOF DI7 to DI0 EIO1 EIO2
O001
91C820A-265
2006-01-31
TMP91C820A
3.14.4.8 Sample Program * Example: In case of use 240 SEG x 240 COM, 4-level gray scale display, 64-Mbit SDRAM. This sample program operate correctly, LCD panel shows Figure 3.14.18 display. ;***** SDRAM SET ***** LD (sdacr), 2bH LD (sdrcr), 01H ;***** GLCDC SET ***** LD (lcdmode), 17H LD (lcddvm), 11 LD (lcdsize), 32H LD (lcdctl), 20H LD (lcdffp), 240 LD (lcdgl), 01h LD (lcdcm), 0c1H LD (lcdcw), 19 LD (lcdch), 19 LD (lcdcp), 00H LD (lcdcpl), 00H LD (lcdcpm), 00H LD (lcdcph), 40H LD (lsarch), 40H LD (lsarcm), 00H LD (lsarcl), 00H ;***** 0/4 data write 60 ROW ***** LD xix, 400000H LD wa, 0000H loop1: LD (xix), wa INC 2, xix CP xix, 407800H JR nz, loop1 ;***** 2/4 data write 60 ROW ***** LD xix, 407800H LD wa, 05555H loop2: LD (xix), wa INC 2, xix CP xix, 40F000H JR nz, loop2
; Add-MUX enable, 64-Mbit select ; Interval refresh
; A/B area off, SDRAM 64 Mbits, SR type ; SCP width 2 clocks ; 11-count DVM set ; COM = 240, SEG = 240 ; Divide frame ON, display OFF ; Frame frequency correction (91 Hz) ; 4-level gray ; Cursor ON, black, 2 Hz blink ; Width = 20 dots ; Height = 20 dots ; Pixel = 0 ; Cursor position ; Cursor address ; Cursor address ; C_area start address ; C_area start address ; C_area start address ; ; Write data 0/4 gray data (0000000000000000b) ; ; ; 400000H to 4077FFH: 60 ROW (Dot) ; ; ; Write data 2/4 gray data (0101010101010101b) ; ; ; 407800H to 40EFFFH: 60 ROW (Dot) ;
91C820A-266
2006-01-31
TMP91C820A
;***** 3/4 data write 60 ROW ***** LD xix, 40F000H ; LD wa, 0aaaaH ; Write data 3/4 gray data (1010101010101010b) loop3: LD (xix), wa ; INC 2, xix ; CP xix, 416800H ; 40F000H to 4167FFH: 60 ROW (Dot) JR nz, loop3 ; ;***** 4/4 data write 60 ROW ***** LD xix, 416800H ; LD wa, 0ffffH ; Write data 4/4 gray data (1111111111111111b) loop4: LD (xix), wa ; INC 2, xix ; CP xix, 41e000H ; 416800H to 41DFFFH: 60 ROW (Dot) JR nz, loop4 ; ;***** 4-level gray palette pattern set ***** LD (lg0l), 00H ; 0/4 gray scale palette 0000b LD (lg1l), 05H ; 2/4 gray scale palette 0101b LD (lg2l), 0eH ; 3/4 gray scale palette 1110b LD (lg3l), 0fH ; 4/4 gray scale palette 1111b ;***** DMA, DISPLAY-ON start ***** LD (lcdctl), 0a1H ; Display on, divide on
Cursor blink (Black, 2Hz) 20 dots 20 dots 60 dots
60 dots 240 COM (Dots) 60 dots
60 dots
240 seg (Dots) Figure 3.14.18 Display Reference above Sample Program
91C820A-267
2006-01-31
TMP91C820A
3.14.5
RAM Built-in Type LCD Driver Control Mode (RAM type)
Data transmission to LCD driver is executed by move instruction of CPU. After setting mode of operation to SFR, when move instruction of CPU is executed LCDC outputs chip select signal to LCD driver connected to the outside from control pin (D1BSCP etc.). Therefore control of data transmission numbers corresponding to LCD size is controlled by instruction of CPU. There are 2 kinds of address of LCD driver in this case, and which is chosen determines by LCDCTL register. It corresponds to LCD driver which has every 1 byte of instruction register and display data register in LCD driver at the time of = "0". Please make the transmission place address at this time into either of FE0H to FE7F. (SEQUENTIAL ACCESS TYPE: See Table 3.14.3) It corresponds to address direct writing type LCD driver at the time of = "1". The transmission place address at this time can also assign the memory area of 3C0000H to 3FFFFFH to four area for every 64 Kbytes. (RANDOM ACCESS TYPE: See Table 3.14.4)
[Write cycle] System clock: fSYS A23 to A0
R/W
3.14.5.1 Operation
[Read cycle]
D1BSCP, D2BLP, D3BFR, DLEBCD D7 to D0 Data-out Data-in
Figure 3.14.19 Example of Access Timing for RAM Built-in Type LCD Driver (Wait = 0)
91C820A-268
2006-01-31
TMP91C820A
3.14.5.2 Interface Examples at Internal RAM Mode
TMP91C820A
VDD VSS Power supply circuit
T6B66A (65-row driver)
VDD COM001 COM001
VSS VLC1, VLC2, VLC3, VLC4, VLC5 LE DB5 to DB0 DSPOF SEG001 COM065 WR COM065
65COM x 80SEG LCD
SEG080 Power supply circuit
DLEBCD D1BSCP WR A0 DOFF D7 to D0 Open SEG001 SEG080 CE WR D/I
VDD
VDD VSS
T6B65A (80-column driver)
Note: Other circuit is necessary for LCD drive power supply for LCD driver display.
Figure 3.14.20 Interface Example for RAM Built-in Type Sequential Access Type LCD DRIVER
VSS
DB7 to DB0 EIO1 EIO2
VLC2, VLC3, VLC5
91C820A-269
2006-01-31
TMP91C820A
3.14.5.3 Sample Program * Example: In case of use 80SEG x 65COM LCD driver.
Assign external column driver to LCDC1 and row driver to LCDC4. This example used LD instruction in setting of instruction and used burst function of micro DMA in transmitting of display data. In case of store 650 bytes transfer data to LCD driver. ; ***** Setting external terminal ***** LD (pdcr), 19H ; CE for LCDC1:D1BSCP, ; LE for LCDL1:DLEBCD, ; Setting for DOFF ; ***** Setting for LCDC ***** LD (lcdmode), 00H ; Select RAM mode LD (lcdctl), 00H ; MMULCD = 0 (Sequential access mode) ; ***** Setting for mode of LCDC0/LCDR0 ***** LD (lcdc1l), xx ; Setting instruction for LCDC1 LD (lcdc4l), xx ; Setting instruction for LCDC4 ;***** Setting for micro DMA and INTTC (ch 0) ***** LD a, 08H ; Source address INC mode LDC dmam0, a ; LD wa, 650 ; Count = 650 LDC dmac0, wa ; LD xwa, 1000H ; Source address = 1000H LDC dmas0, xwa ; LD xwa, 0fe1H ; Destination address = FE1H (LCDC0H) LDC dmad0, xwa ; LD (intetc01), 06H ; INTTC0 level = 6 EI 6 ; LD (dmab), 01H ; Burst mode LD (dmar), 01H ; Soft start
91C820A-270
2006-01-31
TMP91C820A
3.15 Melody/Alarm Generator (MLD)
TMP91C820A incorporates melody function and alarm function, both of which are output from the MLDALM pin. Five kind of fixed cycles interrupt is generate by using 15-bit counter, which is used for alarm generator. Features are as follows. * Melody generator The melody function generates signals of any frequency (4 Hz to 5461 Hz) based on low-speed clock (32.768 kHz) and outputs the signals from the MLDALM pin. By connecting a loud speaker outside, melody tone can easily sound. * Alarm generator The Alarm function generates eight kinds of alarm waveform having a modulation frequency (4096 Hz) determined by the low-speed clock (32.768 kHz). And this waveform is able to invert by setting a value to a register. By connecting a loud speaker outside, alarm tone can easily sound. Five kind of fixed cycles (1 Hz, 2 Hz, 64 Hz, 512 Hz, 8192 Hz) interrupts be generated by using a counter which is used for alarm generator. * Special mode It is assigned at bit0 and at bit1, of EMCCR0 register (00E7hex). These bits are used when you want to operate LCDC and MELODY circuit without low-frequency clock (XTIN, XTOUT). After reset these two bits set to 0 and low clock is supplied each LCDC and MELODY circuit. If you write these bits to 1, TA3 (Generate by timer 3) is supplied each LCDC and MELODY circuit. In this case, you should set 32 kHz timer 3 frequency. For detail, look AC specification characteristics. This section is constituted as follows. 3.15.1 Block Diagram 3.15.2 Control Registers 3.15.3 Operational Description 3.15.3.1 Melody Generator 3.15.3.2 Alarm Generator
91C820A-271
2006-01-31
TMP91C820A 3.15.1 Block Diagram
[Melody generator]
Internal data bus Reset
MELFH EMCCR0 Low-speed clock (32.768 kHz) TA30UT
MELFH, MELFL register Invert Comparator (CP0)
MELOUT
F/F Clear
Stop and clear
Selector
12-bit counter (UC0)
Edge ditector 15-bit counter (UC1)
4096 Hz MELALMC
INTALM0 (8192Hz) INTALM1 (512 Hz) INTALM2 (64 Hz) INTALM3 (2 Hz) INTALM4 (1 Hz)
ALMINT MELOUT Selector
INTALMH (Halt release)
8-bit counter Alarm waveform generator
MLDALM pin
Invert ALMOUT MELALMC

MELALMC
ALM register

[Alarm generator]
Internal data bus Reset
Figure 3.15.1 MLD Block Diagram
91C820A-272
2006-01-31
TMP91C820A 3.15.2 Control Registers
ALM R Register
7
ALM (0330H) Bit symbol Read/Write After reset Function AL8
6
AL7
5
AL6
4
AL5 R/W 0
3
AL4
2
AL3
1
AL2
0
AL1
Setting alarm pattern MELALMC Register
7
MELALMC Bit symbol (0331H) Read/Write After reset Function FC1 R/W
6
FC0
5
ALMINV R/W
4
- R/W 0
3
- R/W 0
2
- R/W 0
1
- R/W 0
0
MELALM R/W 0 Output waveform select 0: Alarm 1: Melody
0 0 Free-run counter control Alarm 00: Hold waveform 01: Restart invert 10: Clear 11: Clear and start
1: Invert
Always write "0".
Note 1: MELALMC is read always 0. Note 2: When setting MELALMC register except during the free-run counter is running, is kept 01.
MELFL Register
7
MELFL (0332H) Bit symbol Read/Write After reset Function ML7
6
ML6
5
ML5
4
ML4 R/W 0
3
ML3
2
ML2
1
ML1
0
ML0
Setting melody frequency (Lower 8 bits) MELFH Register
7
MELFH (0333H) Bit symbol Read/Write After reset Function MELON R/W 0 Control melody counter 0: Stop and clear 1: Start
6
5
4
3
ML11
2
ML10 R/W 0
1
ML9
0
ML8
Setting melody frequency (Upper 4 bits)
ALMINT Register
7
ALMINT (0334H) Bit symbol Read/Write After reset Function
6
5
- R/W 0 Always write "0".
4
IALM4E
3
IALM3E
2
IALM2E R/W 0
1
IALM1E
0
IALM0E
1: Interrupt enable for INTALM4 to INTALM0
91C820A-273
2006-01-31
TMP91C820A 3.15.3 Operational Description
The melody function generates signals of any frequency (4 Hz to 5461 Hz) based on low-speed clock (32.768 kHz) and outputs the signals from the MLDALM pin. By connecting a loud speaker outside, melody tone can easily sound. (Operation) At first, MELALMC have to be set as 1 in order to select melody waveform as output waveform from MLDALM. Then melody output frequency has to be set to 12-bit register MELFH, MELFL. Followings are setting example and calculation of melody output frequency. (Formula for calculating of melody waveform frequency) at fs = 32.768 [kHz] melody output waveform setting value for melody fMLD [Hz] = 32768/(2 x N + 4) N = (16384/fMLD) - 2
3.15.3.1 Melody Generator
(Notice: N = 1 to 4095 (001H to FFFH), 0 is not acceptable) (Example program) In case of outputting a musical scale (440 Hz) LD LD LD (MELALMC), 11X00001B ; Select melody waveform (MELFL), 23H (MELFH), 80H ; N = 16384/440 - 2 = 35.2 = 023H ; Start to generate waveform
(Ref: Basic musical scale setting table) Scale
C D E F G A B C
Frequency [Hz]
264 297 330 352 396 440 495 528
Register Value: N
03CH 035H 030H 02DH 027H 023H 01FH 01DH
91C820A-274
2006-01-31
TMP91C820A
3.15.3.2 Alarm Generator The alarm function generates eight kinds of alarm waveform having a modulation frequency 4096 Hz determined by the low-speed clock (32.768 kHz). And this waveform is reversible by setting a value to a register. By connecting a loud speaker outside, alarm tone can easily sound. Five kind of fixed cycles (1 Hz, 2 Hz, 64 Hz, 512 Hz, 8 kHz) INTERRUPT be generated by using a counter which is used for alarm generator. (Operation) At first, MELALMC have to be set as 0 in order to select alarm waveform as output waveform from MLDALM. Then 10 be set on MELALMC register, and clear internal counter. Finally alarm pattern has to be set on 8-bit register of ALM. If it is inverted output-data, set as invert. Followings are example program, setting value of alarm pattern and waveform of each setting value. (Setting value of alarm pattern) Setting Value for ALM Register
00H 01H 02H 04H 08H 10H 20H 40H 80H Other
Alarm Waveform
0 fixed AL1 pattern AL2 pattern AL3 pattern AL4 pattern AL5 pattern AL6pattern AL7 pattern AL8 pattern Undefined (Do not set.)
(Example program) In case of outputting AL2 pattern (31.25 ms/8 times/1 s) LD LD (MELALMC), C0H (ALM), 02H ; Set output alarm waveform ; Free-run counter start ; Set AL2 pattern, start
91C820A-275
2006-01-31
TMP91C820A
Example: Waveform of alarm pattern for each setting value (Not invert).
AL1 pattern (Continuous output) 1 AL2 pattern (8 times/1 s) 31.25 ms 1 AL3 pattern (Once) 1 AL4 pattern (Twice/1 s) 62.5 ms 1 AL5 pattern (3 times/1 s) 62.5 ms 1 AL6 pattern (Once) 62.5 ms 1 AL7 pattern (Twice) 62.5 ms AL8 pattern (Once) 2 1s 1s 2 3 1 2 500 ms 1 1s 2
Modulation frequency (4096 Hz)
8
1
250 ms
91C820A-276
2006-01-31
TMP91C820A
3.16 SDRAM Controller (SDRAMC)
TMP91C820A includes SDRAM controller which supports data access by CPU/LCDC. The features are as follows. (1) Support SDRAM 16- or 64- or 128-Mbit SDRAM (x 16 bits x 2/4 BANKs), not support DDR (2) Automatic initialize function * * * All BANK pre-charge command generate Mode register set generate 8 times auto refresh
(3) Access mode
CPU Access Burst length Addressing mode CAS latency (Clock) Write mode 1 word Sequential 2 Single write LCDC Access Full page Sequential 2 -
(4) Access cycle * CPU access (Read/write) Read cycle: 4 states (222 ns at 36 MHz) Write cycle: 3 states (167 ns at 36 MHz) Access data width: 8 bits/16 bits Burst length: 1 word only * LCDC burst access (Read only) Read cycle: 1 state (55 ns at 36 MHz) Overhead: 4 states (222 ns at 36 MHz) Access data width: 16 bits only Burst length: Full page only (5) Refresh cycle auto generate * * * Auto refresh is generated during another area access. Refresh interval is programmable. Self refresh is supported
Notes: * * * Display data has to set from the head of each page. Program is not operated on SDRAM. Following condition is set by setting Chip select controller CS1. * WAIT setting: 0 WAIT setting only * * Bus width: 8/16 bit only Memory area: Optional
91C820A-277
2006-01-31
TMP91C820A 3.16.1 Control Registers
Figure 3.16.1 shows the SDRAMC control registers. Setting these registers controls the operation of SDRAMC. SDRAM Access Control Register 7
SDACR (04F0H) Bit symbol Read/Write After reset Function SDINI R/W 0 Auto initialize 0: Disable 1: Enable
6
SWRC R/W 0 Write recovery 0: 1 clock 1: 2 clock
5
- R/W 1
4
- R/W 0
3
SMUXE R/W 0 Address multiplex 0: Disable 1: Enable
2
SMUXW1 0 SDRAM select R/W
1
SMUXW0 0
0
SMAC R/W 0 SDRAM
Always write "10".
00: 16 Mbits 10: 128 Mbits controller 01: 64 Mbits 11: Reserved 0: Disable
1: Enable
SDRAM Refresh Control Register 7
SDRCR (04F1H) Bit symbol Read/Write After reset Function SFRC R/W 0 Self refresh 0: Exit 1: Entry 0
000: 78 states 001: 97 states 010:124 states 011:156 states
6
SRS2
5
SRS1 R/W 0
4
SRS0 0
3
- R/W 0 Always write "0".
2
1
0
SRC R/W 0 Auto refresh 0: Disable 1: Enable
Auto refresh interval
100: 195 states 101: 210 states 110: 249 states 111: 312 states
Figure 3.16.1 SDRAMC Control Registers
Self refresh operation is controlled by setting SDRCR, and self-refresh mode become Entry by writing "1" to it. If wrote "0" to SDRCR, Self refresh mode become Exit.
91C820A-278
2006-01-31
TMP91C820A 3.16.2 Operation Description
(1) Memory access control The SDRAMC is enabled by setting SDACR to "1". When one of the bus masters (CPU, LCDC) generates a cycle to access the SDRAM address area, the SDRAMC outputs SDRAM control signals (SDCS, SDRAS, SDCAS, SDWE, SDLDQM, SDUDQM, SDCLK, SDCKE). In the access cycle, address multiplex outputs row/column multiplex address through A1 to A12 pin. And multiplex width is decided by setting SDACR. The relation between multiplex width and memory size is Table 3.16.1. Table 3.16.1 Address Multiplex SDRAM Address Pin Name
- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 BS0 BS1
TMP91C820A Address Output Column Row Address Address 16 Mbits 64 Mbits 128 Mbits
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A20 - A0 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A0 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21 A22 A0 A10 A11 A12 A13 A14 A15 A16
Memory size
A17
A18 A19 A20 A21 A22 A23 Effective column address
TMP91C820A address pin name
SDRAM access by CPU is performed by the 1 word burst mode. SDRAM access by LCDC is performed by 1 page burst mode. SDRAM access cycle is shown in Figure 3.16.2 to Figure 3.16.7. The read cycle by CPU is the 4-state fixation, and a write cycle is the 3-state fixation. In the burst read cycle by LCDC, a mode register setup, a pre-charge cycle, and a refresh cycle are automatically inserted in CPU cycle front and back.
Note:
In SDRAM access cycle, WAIT setup by the CS/WAIT controller (CS1) is disregarded. The wait setting of CS1 should be 0 waits.
91C820A-279
2006-01-31
TMP91C820A
4 states SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS SDWE
A11 A1 to A12 D0 to D15 RA CA In
Bank active
Read with auto precharge
Figure 3.16.2 SDRAM Access Timing (CPU read)
91C820A-280
2006-01-31
TMP91C820A
3 states SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS
SDWE
A11 A0 to A12 D0 to D7 D8 to D15 RA CA Out Out
Bank active
Write with auto precharge
Figure 3.16.3 SDRAM Access Timing (CPU write 16 bits)
91C820A-281
2006-01-31
TMP91C820A
Write recovery cycle
3 states SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS
SDWE
A10 A1 to A12 D0 to D7 D8 to D15 RA CA Out Out
Bank active
Write with auto precharge
Figure 3.16.4 SDRAM Access Timing (CPU write 16 bits, write recovery: 2 clocks)
91C820A-282
2006-01-31
TMP91C820A
SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS SDWE
A11 A1 to A12 D0 to D7 D8 to D15 RA CA Out
Bank active
Write with auto precharge
Figure 3.16.5 SDRAM Access Timing (CPU lower byte write)
91C820A-283
2006-01-31
TMP91C820A
SDCLK SDCKE SDLDQM
SDUDQM
SDCS
SDRAS
SDCAS SDWE
A11 A1 to A12 D0 to D7 D8 to D15 Out RA CA
Bank active
Write with auto precharge
Figure 3.16.6 SDRAM Access Timing (CPU upper byte write)
91C820A-284
2006-01-31
TMP91C820A
165 states (160-word read) SDCLK SDCKE SDLDQM SDUDQM
SDCS SDRAS
SDCAS
SDWE
A11 A1 to A12 D0 to D15 227 RA CA(000)
Da Da+2 Da+4 ......
Da+314 Da+316
220
Da+318
Mode BANK register active set (Full page)
Read
Mode BANK register precharge set (1 word)
Figure 3.16.7 SDRAM Access Timing (LCDC burst read)
91C820A-285
2006-01-31
TMP91C820A
(2) Refresh control The TMP91C820A supports Auto Refresh cycle. When SDRCT is set to "1", the Auto Refresh cycle is automatically generate at intervals specified by SDRCR. The Auto Refresh interval can be specified in a range of 78 states to the 312 states (4.3 s to 17.3 s at 36 MHz). The generating timing of a refresh cycle becomes into access cycles other than SDRAM area (CS1) after the interval setup by . The refresh cycle is shown in Figure 3.16.8. Moreover, the refreshment interval is shown in Table 3.16.2.
2 states
SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS SDWE
Auto refresh
Figure 3.16.8 Refresh Cycle
Table 3.16.2 Auto Refresh Cycle Insertion Interval
setting SRS2 0 0 0 0 1 1 1 1 SRS1 0 0 1 1 0 0 1 1 SRS0 0 1 0 1 0 1 0 1 Insertion interval (State) 78 97 124 156 195 210 247 312 Frequency (fSYS) 5 MHz 15.6 19.4 24.8 31.2 39.0 42.0 49.4 62.4 6.25 MHz 12.5 15.5 19.8 25.0 31.2 33.6 39.5 49.9 8 MHz 9.8 12.1 15.5 19.5 24.4 26.3 30.9 39.0 10 MHz 7.8 9.7 12.4 15.6 19.5 21.0 24.7 31.2 12.5 MHz 6.2 7.8 9.9 12.5 15.6 16.8 19.8 25.0
(Unit: s)
18MHz 4.3 5.4 6.9 8.7 10.8 11.7 13.7 17.3
It does not generate interval refreshment during the burst access to SDRAM by LCDC. The interval refreshment demand generated in the meantime is held only once. When it returns to CPU access cycle, an interval refresh cycle is generated. Furthermore, TMP91C820A can generate a self refresh cycle. The timing of a self refresh cycle is shown in Figure 3.16.9.
91C820A-286
2006-01-31
TMP91C820A
SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS SDWE
Self-refresh cycle
Self refresh entry Halt entry Halt exit Self refresh exit Auto refresh
Figure 3.16.9 Self Refresh Cycle Note 1: SDCLK is output in the IDLE2 mode. Therefore if you stop SDCLK, change PF6 pin to output port before the HALT instruction. Note 2: Pin condition under the IDLE1/STOP mode depends on the setting of SYSCR2. SDCKE doesn't depend on it but outputs low level. If SDRCR is set to 1, the self-refresh cycle shown in Figure 3.16.9 will occur. The self refreshment mode is used when using the standby mode (STOP, IDLE1) which an internal clock stops. Before HALT instruction (STOP, IDLE1) of interval refreshment in the state of enable, please set SDRCR to 1. Release of a self refresh cycle is automatically performed by release in the standby mode. It inserts automatically one interval refreshment after self refreshment release, and returns to the interval refreshment mode. (Note: When HALT instruction is cancelled by a reset, the I/O registers are initialized, therefore, refresh is not performed.). Please do not place the command which accesses SDRAM just before the command which sets 1 to SDRCR. After setting SDRCR to 1, make sure that the HALT instruction comes after NOP or some instruction.
91C820A-287
2006-01-31
TMP91C820A
(3) SDRAM Initialize After reset release, TMP91C820A can generate the cycle of the following required at the time of the power-supply injection to SDRAM. The cycle is shown in Figure 3.16.10. 1. Precharge of all banks 2. The initial configuration to a mode registers 3. The refresh cycle of 8 cycles The above mentioned cycle is generated by setting 1 to SDACR. While this cycle is executing, the CPU operation (instruction fetch, execution) is halted. Before executing the initialization sequence, appropriate port settings must be made to enable the SDRAM control signals and address signals (A1 to A12).
SDCLK SDCKE SDLDQM SDUDQM
SDCS
SDRAS
SDCAS
SDWE
A11 A1 to A12 620 220
All bank Mode Auto precharge register refresh set (1 word)
Auto refresh
Auto refresh
Auto refresh
Auto refresh
8 times auto-refresh cycle
Figure 3.16.10 Initialize Cycle
91C820A-288
2006-01-31
TMP91C820A
(4) Connection example The example of connection with SDRAM is shown in Figure 3.16.11.
TMP91C820A SDCLK SDCKE D0 to D15 A1 to A12 A13 A14 SDLDQM SDUDQM
SDRAM CLK CKE DQ0 to DQ15 A0 to A11 BS0 BS1 LDQM UDQM
SDCS
SDRAS
SDCAS
CS
RAS
CAS
WE
(1 M word x 4 BANKS x 16 bits)
SDWE
Figure 3.16.11 Connection with SDRAM
91C820A-289
2006-01-31
TMP91C820A
(5) Limitation point to use SDRAM There are some points to notice when using SDRAMC. Please refer to the section under below and take care. 1) WAIT access When using SDRAM, it is added some limitation of access to all other memories. Under the N-WAIT setting of this MCU, it is prohibited inserting the time over (14 x refresh interval time; in Auto Refresh function controlled by SDRAM controller). 2) Execution of SDRAM command before HALT instruction (SR(Self refresh)-Entry , Initialize , Mode-set) It requires execution time (a few states) to execute the command that SDRAMC has (SR- Entry, Initialize). Therefore when executing HALT instruction after the SDRAM command, please insert over 10 bytes NOP or other 10 bytes instructions before HALT instruction. 3) AR (Auto Refresh) interval time When using SDRAM, CPU clock must be set suitable speed for SDRAM's specification that is minimum operating clock and minimum Refresh interval time. When using SDRAM under slow mode or down the Clock Gear, please design the system with special care for Auto Refresh interval time. And please set Auto Refresh interval time after adding 10 states to distributed Auto Refresh interval time, because it might not meet the A.C specification of SDRAM by stopping Auto Refresh. (Example of calculation) Condition: fSYS = 18MHz, SDRAM specification of distributed Auto Refresh interval time = 4096 times/64 ms 64ms/ 4096 times = 15.625s/1 time = 281.25state/1 time 281.25 - 10 = 271.25 state/less than 1 time is needed 247 state is needed
91C820A-290
2006-01-31
TMP91C820A
4) Auto Exit problem when exiting from Self Refresh Mode of SDRAM When using Self Refresh function together with stand-by function of CPU or changing clock, it might not be suit specification of SDRAM. Because automatic releasing Self Refresh function (Auto Exit function) operates by CPU releasing HALT mode. Following figure shows example for avoid this problem by S/W. (Outline concept to control)
Gear-down or Change to Low clock fSYS 18MHz 32KHz CPU SR ENTRY
Change to port Change CLK
Gear-up or Change to High clock
Interrupt
HALT
SR ENTRY
HALT mode
Change CLK
Change to port
SR EXIT
Port condition SDRAM control pin General port setting SDRAM control pin
SDRAM controller internal condition AR condition SR condition AR condition SR condition AR condition
Auto EXIT SDRAM condition AR condition SR condition AR condition
*The target ports to change are SDCKE pin and SDCS pin. *The method of Self refresh Entry includes the condition 4). * SR : Self refresh , AR : Auto refresh
91C820A-291
2006-01-31
TMP91C820A
3.17 16-Bit Timer (TMRB)
The TMP91C820A incorporates one multifunctional 16-bit timer (TMRB0) which have the following operation modes: * Interval timer mode
Timer consists of a 16-bit up counter, two 16-bit timer registers (One of them with a double-buffer structure), a 16-bit capture registers, two comparators, a capture input controller, a timer flip-flop and a control circuit. Timer is controlled by an 11-byte control SFR. This chapter consists of the following items: 3.17.1 3.17.2 3.17.3 3.17.4 Block Diagram Operation SFRs Operation in Each Mode
(1) 16-bit timer mode (2) 16-bit programmable pulse generation (PPG) output mode
Table 3.17.1 Pins and SFR of TMRB0 Channel TMRB0 Spec
External pins External clock/capture trigger input pins Timer flip-flop output pins Timer run register Timer mode register Timer flip-flop control register None TB0OUT0 (also used as PB6) TB0RUN (0180H) TB0MOD (0182H) TB0FFCR (0183H) TB0RG0L (0188H) SFR (Address) Timer register TB0RG0H (0189H) TB0RG1L (018AH) TB0RG1H (018BH) TB0CP0L (018CH) Capture register TB0CP0H (018DH) TB0CP1L (018EH) TB0CP1H (018FH)
91C820A-292
2006-01-31
3.17.1
Internal data bus
INT output Register0 Register 1 INTTB10 INTTB11
Prescaler clock : T0 2 4 T4 Capture register 0 TB0CP0H/L TB0MOD TB0RUN TB0MOD Count clock 16-bit up counter (UC0) Timer flip-flop control Timer flip-flop TB0FF0 T16 T1 8
Block Diagram
Run/ clear TB0RUN 16 32
Timer flip-flop Output TB0OUT0
Capture external interrupt input control
TB1MOD T1 T4 T16 TB0MOD
Selector
Figure 3.17.1 Block Diagram of TMRB0
91C820A-293
16-bit comparator (CP0) Match detection 16-bit timer register TB0RG0H/L TB0RUN Register buffer 0 Intenal data bus
16-bit comparator (CP1)
Match detection
16-bit time register TB0RG1H/L
Intenal data bus
TMP91C820A
2006-01-31
TMP91C820A 3.17.2 Operation
(1) Prescaler The 5-bit prescaler generates the source clock for TMRB0. The prescaler clock (T0) is divided clock (Divided by 4) from selected clock by the register SYSCR0 of clock gear. This prescaler can be started or stopped using TB0RUN. Counting starts when is set to 1; the prescaler is cleared to zero and stops operation when is set to 0.
Table 3.17.2 Prescaler Clock Resolution
at fc = 36 MHz, fs = 32.768 kHz
System Clock Selection
1 (fs)
Prescaler Clock Selection
Clock Gear Value
XXX 000 (fc)
3 3 4 5 6 7
Prescaler Clock Resolution T1
2 /fs (244 s) 2 /fc (0.2 s) 2 /fc (0.4 s) 2 /fc (0.9 s) 2 /fc (1.8 s) 2 /fc (3.6 s) 2 /fc (3.6s)
7 5 5 6 7 8 9
T4
2 /fs (977 s) 2 /fc (0.9 s) 2 /fc (1.8 s) 2 /fc (3.6 s) 2 /fc (7.1 s) 2 /fc (14.2 s) 2 /fc (14.2 s)
9 7 7 8 9
T16
2 /fs (3.9 ms) 2 /fc (3.6 s) 2 /fc (7.1 s) 2 /fc (14.2 s) 2 /fc (28.4 s)
10 11
00 (fFPH) 0 (fc) 10 (fc/16 clock)
001 (fc/2) 010 (fc/4) 011 (fc/8) 100 (fc/16) XXX
2 /fc (56.9 s) 2 /fc (56.9 s)
11
xxx: Don't care (2) Up counter (UC0) UC0 is a 16-bit binary counter which counts up pulses input from the clock specified by TB0MOD. Any one of the prescaler internal clocks T1, TB0 and T16 can be selected as the input clock. Counting or stopping and clearing of the counter is controlled by TB0RUN. When clearing is enabled, the up counter UC0 will be cleared to zero each time its value matches the value in the timer register TB0RG1H/L. Clearing can be enabled or disabled using TB0MOD. If clearing is disabled, the counter operates as a free running counter. A timer overflow interrupt (INTTBOF0) is generated when UC0 overflow occurs.
91C820A-294
2006-01-31
TMP91C820A
(3) Timer registers (TB0RG0 and TB0RG1) These two 16-bit registers are used to set the interval time. When the value in the up counter UC0 matches the value set in this timer register, the comparator match detect signal will go active. Setting data for both upper and lower timer registers is needed. For example, using 2-byte data transfer instruction or using 1-byte date transfer instruction twice for lower 8 bits and upper 8 bits in order. The TB0RG0 timer register has a double-buffer structure, which is paired with register buffer. The value set in TB0RUN determines whether the double-buffer structure is enabled or disabled: it is disabled when = 0, and enabled when = 1. When the double buffer is enabled, data is transferred from the register buffer to the timer register when the values in the up counter (UC0) and the timer register TB0RG1 match. After a reset, TB0RG0 and TB0RG1 are undefined. If the 16-bit timer is to be used after a reset, data should be written to it beforehand. On a reset is initialized to 0, disabling the double buffer. To use the double buffer, write data to the timer register, set to 1, then write data to the register buffer as shown below. TB0RG0 and the register buffer both have the same memory addresses (000188H and 000189H) allocated to them. If = 0, the value is written to both the timer register and the register buffer. If = 1, the value is written to the register buffer only. The addresses of the timer registers are as follows:
TMRB0 TB0RG0 Upper 8 bits (TB0RG0H) 000189H Lower 8 bits (TB0RG0L) 000188H TB0RG1 Upper 8 bits (TB0RG1H) 00018BH Lower 8 bits (TB0RG1L) 00018AH
The timer registers are write-only registers and thus cannot be read.
91C820A-295
2006-01-31
TMP91C820A
(4) Capture registers (TB0CP0H/L) These 16-bit registers are used to latch the values in the up counters. Data in the capture registers should be read all 16 bits. For example, using a 2-byte data load instruction or two 1-byte data load instructions. The least significant byte is read first, followed by the most significant byte. The addresses of the capture registers are as follows:
TMRB0 TB0CP0 MS 8 bits (TB0CP0H) 00018DH LS 8 bits (TB0CP0L) 00018CH
The capture registers are read-only registers and thus cannot be written to.
(5) Capture input control This circuit controls the timing to latch the value of up-counter UC0 into TB0CP0. The value in the up-counter can be loaded into a capture register by software. Whenever 0 is written to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0. It is necessary to keep the prescaler in RUN mode (e.g., TB0RUN must be held at a value of 1). (6) Comparators (CP0 and CP1) CP0 and CP1 are 16-bit comparators which compare the value in the up counter UC0 with the value set in TB0RG0 or TB0RG1 respectively, in order to detect a match. If a match is detected, the comparator generates an interrupt (INTTB00 or INTTB01 respectively). Note: As described above, whenever 0 is written to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0. However, note that the current value in the up counter is also loaded into capture register TB0CP0 when 1 is written to TB0MOD while this bit is holding 0.
Notice "0" WR Write to TB0MOD register TB0MOD CAPTURE operation Capture Capture Capture No capture "0" WR "1" WR "1" WR
(7) Timer flip-flops (TB0FF0) These flip-flops are inverted by the match detect signals from the comparators and the latch signals to the capture registers. Inversion can be enabled and disabled for each element using TB0FFCR. After a reset the value of TB0FF0 is undefined. If 00 is written to TB0FFCR or , TB0FF0 will be inverted. If 01 is written to the capture registers, the value of TB0FF0 will be set to 1. If 10 is written to the capture registers, the value of TB0FF0 will be set to 0. The values of TB0FF0 can be output via the timer output pins TB0OUT0 (which is shared with PB6). Timer output should be specified using the port B function register.
91C820A-296
2006-01-31
TMP91C820A 3.17.3 SFRs
TMRB0 Run Register
7
TB0RUN (0180H) Bit symbol Read/Write After reset Function TB0RDE R/W 0 Double buffer 0: Disable 1: Enable
6
- R/W 0 Always fixed to "0".
5
4
3
I2TB0 R/W 0
2
TB0PRUN
1
0
TB0RUN R/W 0
R/W 0
16-Bit timer run/stop control IDLE2 0: Stop and clear 0: Stop 1: Operate 1: Run (Count up)
Count operation 0 1 Stop and clear Count
I2TB0: Operation during IDLE2 mode TB0PRUN: Operation of prescaler Note: The 1, 4 and 5 of TB0RUN are read as undefined value. TB0RUN: Operation of TMRB0
Figure 3.17.2 Register for TMRB
TMRB0 Mode Register
7
TB0MOD (0182H) Prohibit readmodifywrite Bit symbol Read/Write After reset Function 0 - R/W
6
- 0
5
TB0CP01 W* 1 Execute software capture 0: Execute 1: Undefined
4
- R/W 0
3
- R/W 0
2
TB0CLE 0 counter 0: Disable 1: Enable clearing
1
TB0CLK1 R/W 0 00: Reserved 01: T1 11: T16
0
TB0CLK0 0
Always write "00".
Always write "00".
Control up TMRB0 source clock
clearing 10: T4
TMRB0 source clock 00 01 10 11 Reserved T1 T4 T16
Up counter clear control 0 1 Disable TB0RG1 clearing on match with TB0RG1.
Software capture 0 1 The value in the up counter is captured to TB0CP0. Undefined (Note)
Note: As described above, whenever 0 is written to TB0MOD, the current value in the up counter is loaded into capture register TB0CP0. However, note that the current value in the up counter is also loaded into capture register TB0CP0 when 1 is written to TB0MOD while this bit is holding 0.
Figure 3.17.3 Register for TMRB
91C820A-297
2006-01-31
TMP91C820A
TMRB0 Flip-flop Control Register
7
TB0FFCR Bit symbol (0183H) Read/Write After reset Prohibit readmodifywrite Function
-
6
-
5
-
4
TB0C0T1
3
TB0E1T1
2
TB0E0T1
1
TB0FF0C1
0
TB0FF0C0
W 1 1 Always write "11".
R/W 0 Always write "0". 0
R/W 0 0 1 TB0FF0 inversion trigger 0: Disable trigger 1: Enable trigger
W* 1 Control TB0FF0 00: Invert 01: Set 10: Clear 11: Undefined Always read as "11".
Invert when the UC value is loaded in to TB0CP0.
Invert when the UC value matches the value in TB0RG1.
Invert when the UC value matches the value in TB0RG0.
TB0FF0 control 00 01 10 11 Invert Set to 11 Clear to 00 Undefined (Always read as "11")
Inverted when the UC value matches the valued in TB0RG0. 0 1 Disable trigger Enable trigger
Inverted when the UC value matches the valued in TB0RG1. 0 1 Disable trigger Enable trigger
Inverted when the UC value is loaded in to TB0CP0. 0 1 Disable trigger Enable trigger
Figure 3.17.4 Register for TMRB
91C820A-298
2006-01-31
TMP91C820A
Timer register
7
TB0RG0L (0188H) bit Symbol Read/Write After reset TB0RG0H (0189H) bit Symbol Read/Write After reset TB0RG1L (018AH) bit Symbol Read/Write After reset TB0RG1H (018BH) bit Symbol Read/Write After reset
6
5
4
W Undefined W Undefined W Undefined W Undefined
3
2
1
0
Note: Above registers are prohibited Read-modify-write instruction.
Figure 3.17.5 Register for TMRB
91C820A-299
2006-01-31
TMP91C820A 3.17.4 Operation in Each Mode
(1) 16-bit timer mode Generating interrupts at fixed intervals In this example, the interrupt INTTB01 is set to be generated at fixed intervals. The interval time is set in the timer register TB0RG1.
7 TB0RUN INTETB01 TB0FFCR TB0MOD TB0RG1 TB0RUN 0 X 1 0 * * 0 6 0 1 1 0 * * 0 5 X 0 0 1 * * X 4 X 0 0 0 * * X 3 - X 0 0 * * - 2 0 0 0 1 * * 1 1 X 0 1 * * * X 0 0 0 1 * * * 1 Stop TMRB0. Enable INTTB01 and set interrupt level 4. Disable INTTB00. Disable the trigger. Select internal clock for input and disable the capture function. Set the interval time. (16 bits) Start TMRB0.
(** = 01, 10, 11)
X: Don't care, -: No change
(2) 16-bit programmable pulse generation (PPG) output mode Square wave pulses can be generated at any frequency and duty ratio. The output pulse may be either low active or high active. The PPG mode is obtained by inversion of the timer flip-flop TB0FF0 that is to be enabled by the match of the up counter UC0 with timer register TB0RG0 or TB0RG1 and to be output to TB0OUT0. In this mode the following conditions must be satisfied. (Value set in TB0RG0) < (Value set in TB0RG1)
Match with TB0RG0 (INTTB00 inerrupt) Match with TB0RG1 (INTTB01 interrupt) TB0OUT0 pin
Figure 3.17.6 Programmable Pulse Generation (PPG) Output Waveforms When the TB0RG0 double buffer is enabled in this mode, the value of register buffer 0 will be shifted into TB0RG0 at match with TB0RG1. This feature facilitates the handling of low-duty waves.
Match with TB0RG0 Match with TB0RG1 TB0RG0 (Value to be compared) Register buffer
Up counter = Q1
Up counter = Q2 Shift into theTB0RG1
Q1 Q2
Q2 Q3 Write into the TB0RG0
Figure 3.17.7 Operation of Register Buffer
91C820A-300
2006-01-31
TMP91C820A
The following block diagram illustrates this mode.
Selector
T1 T4 T16
TB0RUN TB0OUT0 (PPG output)
16-bit up counter UC0
Clear
F/F (TB0FF0)
16-bit comparator
Match
16-bit comparator
Selector
TB0RG0
TB0RG0-WR Register buffer 0 TB0RUN TB0RG1
Internal data bus
Figure 3.17.8 Block Diagram of 16-Bit Mode The following example shows how to set 16-bit PPG output mode:
7 0 * * * * 1 6 0 * * * * 0 5 X * * * * X 4 X * * * * X 3 - * * * * - 2 0 * * * * 0 1 X * * * * X 0 0 * * * * 0
TB0RUN TB0RG0 TB0RG1 TB0RUN
Disable the TB0RG0 double buffer and stop TMRB0. Set the duty ratio. (16 bits) Set the frequency. (16 bits) Enable the TB0RG0 double buffer. (The duty and frequency are changed on an INTTB01 interrupt.) Set the mode to invert TB0FF0 at the match with TB0RG0/TB0RG1. Set TB0FF0 to 0. Select the internal clock as the input clock and disable the capture function. Set PB6 to function as TB0OUT0. Start TMRB0.
TB0FFCR TB0MOD PBCR PBFC TB0RUN
X 0 X X 1
X 0 1 1 0
0 1 - - X
0 0
1
1
1
0
01** (** = 01, 10, 11) --X-- --X-- X-1X1
X: Don't care, -: No change
91C820A-301
2006-01-31
TMP91C820A
3.18 Hardware Standby Function
TMP91C820A have hardware standby circuit that is able to save the power consumption and protect from program runaway by supplying power voltage down. Especially, it's useful in case of battery using. It can be shifted to "PS condition" by fixed PS pin to "low" level. Figure 3.18.1 shows timing diagram of transition of PS condition below. PS mode can release only external system reset.
fSYS
RESET
PS
(Note1)
Keep to
PS
pin
Shifting time (Note 2 Power save condition Reset condition (Release PS mode)
More than 10 clock
Note 1: PS pin is effective after RESET because SYSCR2 to 0. If you use as NMI pin, please write SYSCR2 to 1. Note 2: Shifting time is 2 to 10 clock times of fSYS. Figure 3.18.1 Hardware Standby Timing Diagram Table 3.18.1 Power Save Mode Conditions of Each HALT Mode HALT Mode Setting
PS condition
IDLE2
IDLE1 mode + High-frequency stop
IDLE1
IDLE1 mode + High-frequency stop
STOP
STOP mode
Note:
Settings of SYSCR2 and at HALT mode are effective as well as PS condition.
91C820A-302
2006-01-31
TMP91C820A
4.
4.1
Electrical Characteristics
Maximum Ratings
Parameter
Power supply voltage Input voltage Output current Output current Output current (Total) Output current (Total) Power dissipation (Ta = 85C) Soldering temperature (10 s) Storage temperature Operating temperature
Symbol
Vcc VIN IOL IOH IOL IOH PD TSOLDER TSTG TOPR
Rating
-0.5 to 4.0 -0.5 to Vcc + 0.5 2 -2 80 -80 600 260 -65 to 150 -20 to 70
Unit
V
mA
mW C
Note: The maximum ratings are rated values which must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any maximum rating is exceeded, a device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products which include this device, ensure that no maximum rating value will ever be exceeded.
4.2
DC Characteristics (1/2)
Parameter
Power supply voltage (AVCC = DVCC) (AVSS = DVSS = 0 V) D0 to D15 Input low voltage P52 to P7 (except PB3, P9)
RESET , NMI ,
Symbol
VCC
Condition
fc = 4 to 27 MHz fc = 4 to 36 MHz fs = 30 to 34 kHz
Min
2.7 3.0
Typ.
- - - -
Max
3.6
Unit
V
3.6 0.6 0.3 Vcc 0.25 Vcc 0.3 0.2 Vcc V
VIL VIL1 VIL2 VIL3 VIL4 VIH VIH1 VIH2 VIH3 VIH4 VOL VOH
VCC 2.7 V VCC 2.7 V VCC 2.7 V VCC 2.7 V VCC 2.7 V 3.6 V VCC 2.7 V VCC 2.7 V VCC 2.7 V VCC 2.7 V VCC 2.7 V IOL = 1.6 mA IOH = -400 A 2.0 0.7 Vcc 0.75 Vcc Vcc - 0.3 0.8 Vcc - 2.4 -0.3
PB3 (INT0), P9 AM0 to AM1 X1 D0 to D15
- - - - - - - - - -
Input high voltage
P52 to P7 (except PB3, P9)
RESET , NMI ,
Vcc + 0.3
PB3 (INT0), P9 AM0 to AM1 X1
Output low voltage Output high voltage
0.45 -
V
Note: Typical values are for when Ta = 25C and Vcc = 3.0 V unless otherwise noted.
91C820A-303
2006-01-31
TMP91C820A
DC Characteristics (2/2)
Typ. (Note 1)
0.02 0.05 - - - 1.0 - 23.0 16.0 1.6 23.0 14.0 6.0 0.2
Parameter
Input leakage current Output leakage current Power down voltage (at STOP, RAM back up)
RESET pull-up resistor
Symbol
ILI ILO VSTOP RRST CIO VTH
Condition
0.0 VIN Vcc 0.2 VIN Vcc - 0.2 VIL2 = 0.2Vcc, VIH2 = 0.8Vcc 3.6 V VCC 2.7 V fc = 1 MHz VCC 2.7 V 3.6 V VCC 2.7 V Vcc = 3.6 V fc = 36M Hz
Min
- - 1.8 100 - 0.4
Max
5 10 3.6 400 10 -
Unit
A V k pF V
Pin capacitance Schmitt width RESET , NMI , INT0, KI0 to KI7 Programmable pull-up resistor NORMAL (Note 2) IDLE2 IDLE1 SLOW (Note 2) IDLE2 IDLE1 STOP
RKH
100 - - - - - - -
400 35.0 23.0 3.0 45.0 35.0 25.0 15.0
k
mA
Icc
Vcc = 3.6 V fs = 32.768 kHz Vcc = 3.6 V
A A
Note 1: Typical values are for when Ta = 25C and Vcc = 3.0 V unless otherwise noted. Note 2: Icc measurement conditions (NORMAL, SLOW): All functions are operational; output pins are open and input pins are fixed. CL = 30 pF loaded on data and address bus.
91C820A-304
2006-01-31
TMP91C820A
4.3 AC Characteristics
Vcc = 2.7 to 3.6 V case of fFPH = 27 MHz Vcc = 3.0 to 3.6 V case of fFPH = 36 MHz
No. Symbol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 tFPH tAC tCAR tCAW tAD tRD tRR tHR tWW tDW tWD tSBA tSWP tSBW tSAS tSWR tSDS tSDH tAW tCW tAPH tAPH2 tAPO
Parameter
fFPH period (= x) A0 to A23 valid RD / WR fall
RD rise A0 to A23 hold
Variable Min
27.7 x - 23 0.5x -13 x - 13 3.5x - 24 2.5x - 24 2.5x - 15 0 2x - 15 1.5x - 35 x - 25 3x - 39 2x - 15 3x - 25 1.5x - 35 0.5x - 13 2x - 35 0.5x - 13
(1 + N) wait (1 + N) wait
fFPH = 27 MHz Min
37 14 5.5 24 105.5 68.5 77.5 0 59 20.5 12 72 59 86 20.5 5.5 39 5.5
fFPH = 36 MHz Min
27.7 4.7 0.85 14.7 72.95 45.25 54.25 0 40.4 5.5 2.7 44.1 40.4 58.1 6.55 0.85 20.4 0.85
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Max
31250
Max
Max
WR rise A0 to A23 hold
A0 to A23 valid D0 to D15 input
RD fall D0 to D15 input
RD low width
RD rise D0 to D15 hold
WR low width
D0 to D15 valid WR rise
WR rise D0 to D15 hold
Data byte control access time for SRAM Write pulse width for SRAM Data byte control to end of write for SRAM Address setup time for SRAM Write recovery time for SRAM Data setup time for SRAM Data hold time for SRAM A0 to A23 valid WAIT input
RD / WR fall
3.5x - 60 2.5x + 0 3.5x - 89 3.5x 3.5x + 60 129.5 92.5
69.5 69.25 40.5 96.95 189.5
36.95 7.95 156.9
ns ns ns ns ns
WAIT hold
A0 to A23 valid PORT input A0 to A23 valid PORT hold A0 to A23 valid PORT valid
AC measuring conditions * * Output Level: High = 0.7 Vcc, Low = 0.3 Vcc, CL = 50 pF Input Level: High = 0.9 Vcc, Low = 0.1 Vcc
Note: Symbol x in the above table means the period of clock fFPH, it's half period of the system clock fSYS for CPU core. The period of fFPH depends on the clock gear setting or the selection of high-/low-frequency oscillator.
91C820A-305
2006-01-31
TMP91C820A
(1) Read cycle
tFPH fFPH
EA24 to EA25 A23 to A0
CSn
R/ W
tAW tCW
WAIT
tAP Port input (Note) tAPH2 tAD tAC tRR
tCAR
RD
tRD
D0 to D15
SRLB SRUB SRWR
tHR D0 to D15
tSBA
Note: Since the CPU accesses the internal area to read data from a port, the control signals of external pins such as RD and CS are not enabled. Therefore, the above waveform diagram should be regarded as depicting internal operation. Please also note that the timing and AC characteristics of port input/output shown above are typical representation. For details, contact your local Toshiba sales representative.
91C820A-306
2006-01-31
TMP91C820A
(2) Write cycle
fFPH
EA24 to EA25, A23 to A0
CSn
R/ W
WAIT
tAPO Port output (Note) tCAW
WR , HWR
tWW tDW tWD
tSWR
D0 to D15
D0 to D15 tSDH
SRLB SRUB
tSBW tSAS tSWP tSDS
SRWR
Note: Since the CPU accesses the internal area to write data to a port, the control signals of external pins such as WR and CS are not enabled. Therefore, the above waveform diagram should be regarded as depicting internal operation. Please also note that the timing and AC characteristics of port input/output shown above are typical representation. For details, contact your local Toshiba sales representative.
91C820A-307
2006-01-31
TMP91C820A
4.4
SDRAM Controller AC Electrical Characteristics
Vcc = 2.7 to 3.6 V case of fFPH = 27 MHz Vcc = 3.0 to 3.6 V case of fFPH = 36 MHz
No. Symbol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 tRC tRAS tRCD tRP tRRD tWR tWR2 tCK tCH tCL tAC tOH tDS tDH tAS tAH tCKS tCMS tCMH tRSC
Parameter
Ref/active to ref/active command period Active to precharge command period Active to read/write command delay time Precharge to active command period Active to active command period Write recovery time (CL* = 2) Write recovery time CLK cycle time (CL* = 2) CLK high level width CLK low level width Access time from CLK (CL* = 2) Output data hold time Data-in setup time Data-in hold time Address setup time Address hold time CKE setup time Command setup time Command hold time Mode register set cycle time
Variable Min
4X 4X 2X 2X 6X 2X 3X 2X 1X-15 1X-15 1X-25 0 2X-35 2.5X-20 1.5X-35 0.5X-13 1X-15 1X-15 1X-15 2X 12210
27 MHz Min
148 148 74 74 222 74 111 74 22 22 12 0 39 72 20 5 22 22 22 74 12210
36 MHz Min
27.7 111.1 55.6 55.6 166.7 55.6 83 55.6 12.8 12.8 2.8 0 20.6 49.4 6.7 0.9 12.8 12.8 12.8 55.6 12210
Max
Max
Max
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
* CL is CAS latency. AC measuring conditions * * Output level: High = 0.7 Vcc, Low = 0.3 Vcc, CL = 50 pF Input level: High = 0.9 Vcc, Low = 0.1 Vcc
Note: Symbol x in the above table means the period of clock fFPH, it's half period of the system clock fSYS for CPU core. The period of fFPH depends on the clock gear setting or the selection of high-/low-frequency oscillator.
91C820A-308
2006-01-31
TMP91C820A
* SDRAM read timing (CPU access)
fFPH
tC
SDCLK
tC tCL tR tCM
SDCS
tRC
tRA tCM tCM
tRP
SDxDQM
tCM
SDRAS
tRRD
SDCAS SDWE
tAS
tAH
A1 to A12 A20 to A23 (BS0, 1) D0 to D15
Row
tAS
Column
tAH tAC tOH
Data-in
91C820A-309
2006-01-31
TMP91C820A
* SDRAM write timing (CPU access)
fFPH
tC
SDCLK
tC tCL tR tCM
SDCS
tRC tCM
tWR tRRD
tRP
SDxDQM
tCM
SDRAS SDCAS
tCM
tRAS
SDWE
tAS
tAH
A1 to A12 A20 to A23 (BS0, 1) D0 to D15
Row
tAS tDS
Column
tAH tDH
Data-out
*
SDRAM write timing (CPU access, write recivery enable)
fFPH SDCLK
tWR2
SDxDQM
SDCS SDRAS SDCAS SDWE
A1 to A12 A20 to A23 (BS0, 1) D0 to D15
Row
Column
Data-out
91C820A-310
2006-01-31
TMP91C820A
* SDRAM burst read timing (Head of burst cycle)
fFPH
tC
SDCLK
tCM
SDxDQM
SDCS
tR tCM tCM
tRC
SDRAS
tCMS
SDCAS
tCM
tCM
SDWE
tAS
tAH
tAS
tAH
tAS
A1 to A12 A20 to A23 (BS0, 1) D0 to D15
227
Row
Column
tAC
tAC
tAC
Data-in
tOH
Data-in
tOH
Data-in
*
SDRAM burst read timing (End of burst cycle)
fFPH
tC
SDCLK
tCM tCMS tRS tCM tRC
SDxDQM
tCM
SDCS SDRAS
tCMS
SDCAS
tCM
SDWE
tAS
A1 to A12 A20 to A23 (BS0, 1) D0 to D15
Column
220
tAC
tAC
Data-in
tOH
Data-in
tOH
Data-in
tOH
91C820A-311
2006-01-31
TMP91C820A
* SDRAM initialize timing
fFPH
tC
SDCLK
tCH tCL tCMS
SDCS
tRS
tRC
SDxDQM
tCMS
SDRAS
tCMS
SDCAS
tCM tCM
tCM
SDWE
tAS
tAH
tAS
A1 to A12 A20 to A23
220
*
SDRAM refresh timing
fFPH
tC
SDCLK
tRC tRC
SDxDQM
tCMS
SDCS SDRAS SDCAS SDWE
tCM
A1 to A12
*
SDRAM self-refresh timing
fFPH
tC
SDCLK SDCKE SDxDQM
tCM
SDCS SDRAS SDCAS SDWE
tCKS
tCKS
tRC
91C820A-312
2006-01-31
TMP91C820A
4.5
AD Conversion Characteristics
AVcc = Vcc, AVss = Vss
Symbol
VREFH VREFL VAIN
Parameter
Analog reference voltage (+) Analog reference voltage (-) Analog input voltage range
Condition
Min
Vcc - 0.2 V Vss
Typ.
Vcc Vss
Max
Vcc Vss + 0.2 V VREFH
Unit
V
Analog current for analog reference voltage IREF (VREFL = 0V) = 1 = 0 - Error (Not including quantizing errors)
VCC = 2.7 V to 3.6 V
VREFL 0.94 0.02 1.0
1.20 5.0 4.0
mA A LSB
Note 1: 1 LSB = (VREFH - VREFL)/1024 [V]. Note 2: The operation above is guaranteed for fFPH 4 MHz. Note 3: The value of Icc includes the current which flows through the AVCC pin.
91C820A-313
2006-01-31
TMP91C820A
4.6
Serial Channel Timing (I/O internal mode)
(1) SCLK input mode
Vcc = 2.7 to 3.6 V case of fFPH = 27 MHz Vcc = 3.0 to 3.6 V case of fFPH = 36 MHz
Symbol
tSCY tOSS tOHS tHSR tSRD tRDS
Parameter
SCLK period Output data SCLK rising/falling edge* SCLK rising/falling edge* Output data hold SCLK rising/falling edge* Input data hold SCLK rising/falling edge* Valid data input SCLK rising/falling edge* Valid data input
Variable Min
16X tSCY/2 - 4X-110 tSCY/2 + 2X + 0 3X + 10 tSCY - 0 0
27 MHz Max Min
0.59 38 370 121 592 0
36 MHz Min
0.44 0 277 93 443 0
Max
Max
Unit
s ns ns ns ns ns
(2) SCLK output mode Symbol
tSCY tOSS tOHS tHSR tSRD tRDS
Parameter
SCLK period Output data SCLK rising/falling edge* SCLK rising/falling edge* Output data hold SCLK rising/falling edge* Input data hold SCLK rising/falling edge* Valid data input SCLK rising/falling edge* Valid data input
Variable Min
16X tSCY/2 - 40 tSCY/2 - 40 0 tSCY - 1X - 180 1X + 180
27 MHz Min
0.59 256 256 0 375 217
36 MHz Min
0.44 181 181 0 235 207.7
Max
8192X
Max
303
Max
227
Unit
s ns ns ns ns ns
SCLK rising/falling edge*:
The rising edge is used in SCLK rising mode. The Falling edge is used in SCLK falling mode.
Note: Above table's data values at 27 MHz and 36 MHz are calculated from tSCY = 16x base.
tSCY SCLK (Rising up mode) SCLK (Falling down mode) Output DATA TXD
tOSS 0
tOHS 1 tSRD tRDS 1 Valid tHSR 2 Valid 3 Valid 2 3
Input DATA RXD
0 Valid
91C820A-314
2006-01-31
TMP91C820A
4.7
Timer input pulse (TA0IN)
27 MHz 36 MHz (Vcc = 2.7 to 3.6 V) (Vcc = 3.0 to 3.6 V) Min
396 188 188
Symbol
tVCK tVCKL tVCKH
Parameter
Clock period Clock low level width Clock high level width
Variable Min
8X + 100 4X + 40 4X + 40
Unit
ns ns ns
Max
Max
Min
321 151 151
Max
4.8
Interrupt, Capture
(1) NMI , INT0 to INT3 interrupts 27 MHz 36 MHz (Vcc = 2.7 to 3.6 V) (Vcc = 3.0 to 3.6 V) Unit Max Min Max Min Max
188 188 151 151 ns ns
Symbol
tINTAL tINTAH
Parameter
NMI , INT0 to INT3 low level width
NMI , INT0 to INT3 high level width
Variable Min
4X + 40 4X + 40
91C820A-315
2006-01-31
TMP91C820A
4.9
LCD Controller SR Mode
tcw tCWH tCWL D1BSCP tDSU
tDHD
D0 to D7
D0 to D7 out
Vcc = 2.7 to 3.6 V case of fFPH = 27 MHz Vcc = 3.0 to 3.6 V case of fFPH = 36 MHz
No. Symbol 1
2 3 4 5
Parameter
Data valid D1BSCP fall D1BSCP fall Data hold D1SBCP Clock high width D1BSCP Clock low width D1BSCP Clock cycle
Variable Min Max
fFPH = 27 MHz (Case: tm = 0) Min
17 32 27 27 27
fFPH = 36 MHz (Case: tm = 0) Min
7.7 22 17.7 17.7 55.4
Unit ns
ns ns ns ns
Max
Max
tDSU tDHD tCWH tCWL tCW
x - 20 + tm x - 5 + tm x - 10 + tm x - 10 + tm 2x + 2tm
tm = (2SCPW - 1) X
SCPW: Setting of (LCDMODE) X: 1/fFPH
Example: If SCPW = 3 (8 clock mode), fFPH = 36 [MHz] tm = (23 - 1) * 1/36 MHz = 194.4 [ns] Table 4.9.1 tm at fFPH = 36 [MHz] SCP Width
Base SCP 2 clocks 4 clocks 8 clocks

00 01 10 11 0
tm
ns 27.77 ns 83.31 ns 194.4 ns
91C820A-316
2006-01-31
TMP91C820A
4.10 Recommended Crystal Oscillation Circuit
TMP91C820A is evaluated by below oscillator vender. When selecting external parts, make use of this information. Note: Total loads value of oscillator is sum of external loads (C1 and C2) and floating loads of actual assemble board. There is a possibility of miss operating using C1 and C2 value in below table. When designing board, it should design minimum length pattern around oscillator. And we recommend that oscillator evaluation try on your actual using board.
(1) Connection example
X1 Rf Rd Rd X2 XT1 XT2
C1
C2
C1
C2
High-frequency oscillator
Low-frequency oscillator
91C820A-317
2006-01-31
TMP91C820A
(2) TMP91C820A recommended ceramic oscillator: Murata Manufacturing Co., Ltd.
Circuit parameter recommended Parameter of Elements C1 [pF] (47) (47) (15) 30 (30) C2 [pF] (47) (47) (15) 30 (30) Rf [] Open Open Open Open Open Rd [] 0 0 0 1.8 to 2.2 0 0 -40 to +85 Running Condition Voltage of Power [V] Tc [C]
MCU
Oscillation Frequency [MHZ] 2.00 2.50 10.00
Item of Oscillator Upper: Old Lower: New CSTLS2M00G56-B0 CSTLS2M50G56-B0 CSTS1000MG03 *CSTLS10M0G53-B0 CSA12.5MTZ093 *CSALA12M5T55093-B0 CST12.0MTW093 *CSTLA12M5T55093-B0
TMP91C820A
12.50
MCU
Oscillation Frequency [MHz] 4.00 6.750
Item of Oscillator Upper: Old Lower: New CSTS0400MG06 *CSTLS4M00G56-B0 CSTS0675MG06 *CSTLS6M75G56-B0 CSA12.5MTZ *CSALA12M5T55-B0 CST12.0MTW *CSTLA12M5T55-B0 CSALS20M0X53-B0 CSTLS20M0X51-B0 CSALS27M0X51-B0 CSALA32M0X51-B0
Parameter of Elements C1 [pF] (47) (47) 30 (30) 5 (5) Open 3 C2 [pF] (47) (47) 30 (30) 5 (5) Open 3 Rf [] Open Open Open Open Open Open 10K Open Rd [] 0 0 0
Running Condition Voltage of Power [V] Tc [C]
TMP91C820A
12.50
2.7 to 3.6 0 0 0 0 0
-40 to +85
20.00 27.00 32.00
Note: *
In CST ***type oscillator, capacitance C1, C2 is built in. The product numbers and specifications of the resonators by Murata Manufacturing Co., Ltd. are subject to change. For up-to-date information, please refer to the following URL: http://www.murata.co.jp/search/index.html
91C820A-318
2006-01-31
TMP91C820A
5.
Table of SFRs
The special function registers (SFRs) include the I/O ports and peripheral control registers allocated to the 4-Kbyte address space from 000000H to 000FFFH. (1) I/O ports (2) I/O port control (3) Interrupt control (4) Chip select/wait control (5) Clock gear (6) DFM (Clock doubler) (7) 8-bit timer (8) UART/serial channel (9) I2C bus/serial interface (10) AD converter (11) Watchdog timer (12) RTC (Real time clock) (13) Melody/alarm generator (14) MMU (15) LCD controller (16) SDRAM controller (17) 16-bit timer
Table layout Symbol Name Address 7 6 1 0 Bit symbol Read/Write Initial value after reset Remarks
Note: "Prohibit RMW" in the table means that you cannot use RMW instructions on these register. Example: When setting bit0 only of the register PxCR, the instruction "SET 0, (PxCR)" cannot be used. The LD (Transfer) instruction must be used to write all eight bits. Read/write R/W: Both read and write are possible. R: W: Only read is possible. Only write is possible.
W*: Both read and write are possible (when this bit is read as 1). Prohibit RMW: Read-modify-write instructions are prohibited. (The EX, ADD, ADC, BUS, SBC, INC, DEC, AND, OR, XOR, STCF, RES, SET, CHG, TSET, RLC, RRC, RL, RR, SLA, SRA, SLL, SRL, RLD and RRD instruction are read-modify-write instructions.) R/W*: Read-modify-write is prohibited when controlling the pull-up resistor.
91C820A-319
2006-01-31
TMP91C820A
Table 5.1 SFR Address Map (1/4)
[1], [2] PORT Address 0000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Address 0030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [3] INTC Address 0080H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH IIMC INTCLR DMAR DMAB Name DMA0V DMA1V DMA2V DMA3V Address 0090H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name INTE0AD INTE12 INTE3ALM4 INTEALM01 INTEALM23 INTETA01 INTETA23 INTERTCKEY INTES0 INTES1 INTES2LCD INTETC01 INTETC23 INTEP01 Reserved Reserved Address 00A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name INTES3 INTETB0 PFFC PF P1CR P1FC P2 P3 P2CR P2FC P3CR P3FC P4 P5 P4CR P4FC Name P0 P1 P0CR Name Address 0010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Address 0070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH PZ PZCR PZFC P6FC2 P7FC2 P9FC PA P7ODE Name P6FC P7CR P7FC P8 P9 P6 P7 Name P5CR Address 0020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH PAFC PB PC PBCR PBFC PCCR PCFC PCODE PD PDFC PBODE PE PECR PEFC Name
Note: Do not access to the unnamed addresses (e.g., addresses to which no register has been allocated).
91C820A-320
2006-01-31
TMP91C820A
Table 5.2 SFR Address Map (2/4)
[4] CS/WAIT Address 00C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [7] TMRA Address 0100H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [8] UART/SIO Address 0200H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH SIRCR SC1BUF SC1CR SC1MOD0 BR1CR BR1ADD SC1MOD1 Name SC0BUF SC0CR SC0MOD0 BR0CR BR0ADD SC0MOD1 Address 0210H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name SC2BUF SC2CR SC2MOD0 BR2CR BR2ADD SC2MOD1 [9] I C bus/SIO Address 0240H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name SBI0CR1 SBI0DBR I2C0AR SBI0CR2/SBI0SR SBI0BR0 SBI0BR1
2
[5], [6] CGEAR, DFM Name B0CS B1CS B2CS B3CS Address 00E0H 1H 2H 3H 4H 5H 6H BEXCS MSAR0 MAMR0 MSAR1 MAMR1 MSAR2 MAMR2 MSAR3 MAMR3 7H 8H 9H AH BH CH DH EH FH DFMCR0 DFMCR1 Name SYSCR0 SYSCR1 SYSCR2 EMCCR0 EMCCR1 EMCCR2 EMCCR3
Name TA01RUN TA0REG TA1REG TA01MOD TA01FFCR
TA23RUN TA2REG TA3REG TA23MOD TA3FFCR
Note: Do not access to the unnamed addresses (e.g., addresses to which no register has been allocated).
91C820A-321
2006-01-31
TMP91C820A
Table 5.3 SFR Address Map (3/4)
[10] 10-bit ADC Address 02A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [11] WDT Address 0300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [13] MLD Address 0330H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name ALM MELALMC MELFL MELFH ALMINT Name WDMOD WDCR Name ADREG04L ADREG04H ADREG15L ADREG15H ADREG26L ADREG26H ADREG37L ADREG37H Address 02B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [12] RTC Address 0320H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [14] MMU Address 0350H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name LOCAL0 LOCAL1 LOCAL2 LOCAL3 Name SECR MINR HOURR DAYR DATER MONTHR YEARR PAGER RESTR Name ADMOD0 ADMOD1
Note: Do not access to the unnamed addresses (e.g., addresses to which no register has been allocated).
91C820A-322
2006-01-31
TMP91C820A
Table 5.4 SFR Address Map (4/4)
[15] LCDC Address 04B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Address 04D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [16] SDRAMC Address 04F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Name SDACR SDRCR Name LG0L LG0H LG1L LG1H LG2L LG2H LG3L LG3H LG4L LG4H LG5L LG5H LG6L LG6H LG7L LG7H Name LCDMODE LCDDVM LCDSIZE LCDCTL LCDFFP LCDGL LCDCM LCDCW LCDCH LCDCP LCDCPL LCDCPM LCDCPH Address 04C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH Address 04E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH [17] TMRB Address 0180H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH TB0RG0L TB0RG0H TB0RG1L TB0RG1H TB0CP0L TB0CP0H TB0CP1L TB0CP1H Name TB0RUN TB0MOD TB0FFCR Name LG8L LG8H LG9L LG9H LGAL LGAH LGBL LGBH LGCL LGCH LGDL LGDH LGEL LGEH LGFL LGFH Name LSARAM LSARAH LEARAM LEARAH LSARBM LSARBH LEARBM LEARBH LSARCL LSARCM LSARCH
Note: Do not access to the unnamed addresses (e.g., address to which no register has been allocated).
91C820A-323
2006-01-31
TMP91C820A
(1) I/O ports (1/2) Symbol
P0
Name
PORT0
Address
00H
7
P07
6
P06
5
P05
4
P04 R/W
3
P03
2
P02
1
P01
0
P00
Data from external port (Output latch register is cleared to 0.) P17 P1 PORT1 01H P27 P2 PORT2 06H P37 P3 PORT3 07H P47 P4 PORT4 0CH P46 P45 P44 R/W Data from external port (Output latch register is cleared to 0.) PZ3 PZ2 R/W 7DH PZ PORTZ (Prohibit RMW*) Data from external port (Output latch register is set to 1.)
0 (Output latch register): Pull-up resistor OFF 1(Output latch register): Pull-up resistor ON
P16
P15
P14 R/W
P13
P12
P11
P10
Data from external port (Output latch register is cleared to 0.) P26 P25 P24 R/W Data from external port (Output latch register is cleared to 0.) P36 P35 P34 R/W Data from external port (Output latch register is cleared to 0.) P43 P42 P41 P40 P33 P32 P31 P30 P23 P22 P21 P20
PZ1
PZ0
1
1
-
P56 R/W
Data from external port (Output latch register is set to 1.) 0(Output latch register): Pull-up resistor OFF 1(Output latch register): Pull-up resistor ON
0DH P5 PORT5 (Prohibit RMW*)
P67 P6 PORT6 12H 1 P77 P7 PORT7 13H P87 P8 PORT8 18H P97 P9 PORT9 19H PA7 PA PORTA 1EH 1
P66 1 P76
P65 1 P75
P64 R/W 1 P74 R/W
P63 1 P73
P62 0 P72
P61 1 P71
P60 1 P70
Data from external port (Output latch register is set to 1.) P86 P85 P84 R Data from external port P96 P95 P94 R Data from external port PA6 1 PA5 1 PA4 R/W 1 1 1 1 1 PA3 PA2 PA1 PA0 P93 P92 P91 P90 P83 P82 P81 P80
91C820A-324
2006-01-31
TMP91C820A
I/O ports (2/2) Symbol Name Address 7 6
PB6 PB PORTB 22H Data from external port (Output latch register is set to 1.) PC5 PC PORTC 23H PD7 PD PORTD 29H 1 PE7 PE PORTE 2CH PF7 PF PORTF 30H 1 1 1 1 PF6 PF5 PF4 R/W 1 1 1 1 R/W 1 PE6 PE5 1 PE4 R/W Data from external port (Output latch register is set to 1.) PF3 PF2 PF1 PF0 1 PE3 PD6 PD4 PD3 PC4 PC3 R/W Data from external port (Output latch register is set to 1.) PD2 R/W 1 PE2 1 PE1 1 PE0 PD1 PD0 PC2
5
PB5 R/W
4
PB4
3
PB3
2
1
PB1 R/W
0
PB0
Data from external port (Output latch register is set to 1.) PC1 PC0
91C820A-325
2006-01-31
TMP91C820A
(2) I/O port control (1/4) Symbol Name Address
P0CR PORT0 control 02H (Prohibit RMW)
7
P07C 0 P17C 0 P17F 0/1 P27C 0/1 P27F 0/1 P37C 0/1 P37F 0/1 P47C 0/1 P47F 0/1
6
P06C 0 P16C 0 P16F 0/1 P26C 0/1 P26F 0/1 P36C 0/1 P36F 0/1 P46C 0/1 P46F 0/1
5
P05C 0 P15C 0 P15F 0/1 P25C 0/1 P25F 0/1 P35C 0/1 P35F 0/1 P45C 0/1 P45F 0/1
4
P04C W 0 0: Input P14C W 0 0: Input P14F W 0/1 P24C W 0/1 0: Input P24F W 0/1 P34C W 0/1 0: Input P34F W 0/1 P44C W 0/1 0: Input P44F W 0/1
3
P03C 0 1: Output P13C 0 1: Output P13F 0/1 P23C 0/1 1: Output P23F 0/1 P33C 0/1 1: Output P33F 0/1 P43C 0/1 1: Output P43F 0/1
2
P02C 0 P12C 0 P12F 0/1 P22C 0/1 P22F 0/1 P32C 0/1 P32F 0/1 P42C 0/1 P42F 0/1
1
P01C 0 P11C 0 P11F 0/1 P21C 0/1 P21F 0/1 P31C 0/1 P31F 0/1 P41C 0/1 P41F 0/1
0
P00C 0 P10C 0 P10F 0/1 P20C 0/1 P20F 0/1 P30C 0/1 P30F 0/1 P40C 0/1 P40F 0/1
P1CR
PORT1 control
04H (Prohibit RMW)
P1FC
PORT1 function
05H (Prohibit RMW)
0: Port, 1: Data bus (D15 to D8) PORT2 control 08H (Prohibit RMW)
P2CR
P2FC
PORT2 function
09H (Prohibit RMW)
0: Port, 1: Address bus (A23 to A16) PORT3 control 0AH (Prohibit RMW)
P3CR
P3FC
PORT3 function
0BH (Prohibit RMW)
0: Port, 1: Address bus (A15 to A8) PORT4 control 0EH (Prohibit RMW)
P4CR
P4FC
PORT4 function
0FH (Prohibit RMW)
0: Port, 1: Address bus (A7 to A0)
91C820A-326
2006-01-31
TMP91C820A
I/O port control (2/4) Symbol Name Address
PZCR PORTZ control 7EH (Prohibit RMW) P56C P5CR PORT5 control 10H (Prohibit RMW) W 0 0: Input 1: Output PZ3F PORTZ function 7FH (Prohibit RMW) 0 0: Port 1: R/W,
SRWE
7
6
5
4
3
PZ3C W 0
2
PZ2C 0
1
0
0: Input 1: Output
PZ2F W 0 0: Port 1: HWR P62F 0 0: Port 1: CS2 P62F2 0
PZ1F 0 0: Port 1: WR P61F 0 0: Port 1: CS1 P61F2 0
PZ0F 0 0: Port 1: RD P60F 0 0: Port 1: CS0 - 0 Always write "0". P70C 0 P70F 0 0: Port
PZFC
P67F P6FC PORT6 function 15H (Prohibit RMW) 0 0: Port 1: SRUB P67F2 PORT6
P66F 0 0: Port 1: SRLB P66F2
P65F 0 0: Port 1: EA25 P65F2
P64F W 0 0: Port 1: EA24 P64F2 W
P63F 0 0: Port 1: CS3 - 0 Always write "0". P73C W 0 1: Output P73F W 0 0: Port
P6FC2
1BH 0 0 0 0 (Prohibit function 2 RMW) 0: 0: 0: 0: 1: CS2E 16H (Prohibit RMW) P77C 0 P77F 17H 0 1: CS2D P76C 0 P76F 0 1: CS2C P75C 0 P75F 0 1: CS2B P74C 0 0: Input P74F 0 0: Port
0: 0: 1: CS2A P72C 0 P72F 0 0: Port 1: SCL 1: SDCS P71C 0 P71F 0 0: Port
P7CR
PORT7 control
P7FC
PORT7 function
(Prohibit 0: Port MSK logic 0: Port RMW) 1: VEECLK select
0: CLK by 1 1: CLK by 0
1: SDA/SO 1: SCK
- 0 P7FC2 1CH PORT7 (Prohibit function 2 RMW) Always write "0".
- 0 Always write "0".
P75F2 0
P74F2 W 0
P73F2 0
- 0
P71F2 0 0:
P70F2 0
SIO0/RXD0 SELECT 0: RXD0 (PC1) 1: OPTRX0 (P70)
0: 0: 0: Always write "0". 1: CS2F 1: CS2G 1: CSEXA
1: OPTTX0 PIN
91C820A-327
2006-01-31
TMP91C820A
I/O port control (3/4) Symbol Name Address
PORT7 P7ODE open drain 1FH (Prohibit RMW) 0
7
- W
6
- 0
5
4
3
2
ODEP72 W 0 0: 3 states
1
ODEP71 0
0
Always write "0". P97F P96F 0 PA6F 0 PB6C 0 PB6F P95F 0 PA5F 0 PB5C W 0 0: Input PB5F W 0 0: Port 1: INT3,
TB0OUT0
1: Open drain P94F W 0 PA7F 0 0 0: Key-in disable PORTA function 21H (Prohibit RMW) PA4F W 0 PB4C 0 1: Output PB4F 0 0: Port 1: INT1 PB3F 0 0: Port 1: INT0 0 PB3C 0 0 0 PB1C W 0 0: Input PB1F W 0 0: Port 0 0: Port 0 1: Output PB0F 0 PB0C 0: CMOS output PORTB control 24H (Prohibit RMW) 1: Open-drain output 0 PA3F 0 PA2F 0 PA1F 0 PA0F 1:Key-in enable P93F P92F P91F P90F PORT9 function 1DH (Prohibit RMW)
P9FC
PAFC
PBCR
PBFC
PORTB function
25H (Prohibit RMW)
0 0: Port 1: INT2
TA3OUT
1: TA1OUT 1: TXD2 ODEPB0
PORTB PBODE open drain
2BH (Prohibit RMW)
W 0 0: CMOS 1: Open drain
PCCR
PORTC control
26H (Prohibit RMW)
PC5C 0 PC5F
PC4C 0
PC3C W 0 0: Input PC3F W 0 0: Port 1: TXD1 ODEPC3 W 0 0: CMOS 1: Open drain
PC2C 0 1: Output PC2F 0 0: Port 1: SCLK0
PC1C 0
PC0C 0 PC0F W 0 0: Port 1: TXD0 ODEPC0 W 0 0: CMOS 1: Open drain
PCFC
PORTC function
27H (Prohibit RMW)
W 0 0: Port 1: SCLK1
PORTC PCODE open drain
28H (Prohibit RMW)
91C820A-328
2006-01-31
TMP91C820A
I/O port control (4/4) Symbol Name Address
2AH
7
PD7F W 0
6
PD6F 0
5
4
PD4F 0 0: Port
3
PD3F 0 0: Port
2
PD2F W 0 0: Port
1
PD1F 0 0: Port 1: D2BLP PE1C 0 PE1F 0 PF1F 0 0: Port 1: SDCAS
0
PD0F 0 0: Port 1: D1BSCP PE0C 0 PE0F 0 PF0F 0 0: Port 1: SDRAS
PDFC
PORTD function
(Prohibit 0: Port RMW) 0: Port 1:MLDALM 1: ALARM
MLDALM
1: DOFFB 1: DLEBCD 1:D3BFR PE5C 0 PE5F 0 PF5F 0 0: Port PE4C W 0 0: Input PE4F W 0 PF4F W 0 0: Port PE3C 0 1: Output PE3F 0 PF3F 0 0: Port PE2F 0 PF2F 0 0: Port PE2C 0
PECR
PORTE control
2DH (Prohibit RMW)
PE7C 0 PE7F 0 -
PE6C 0 PE6F 0 PF6F 1 0: Port 1: SDCLK
PEFC
PORTE function
2EH (Prohibit RMW)
0: Port 1: LD7 to LD0 for LCD driver 32H (Prohibit 0 RMW) Always write"0".
PFFC
PORTF function
1: SDCKE 1: SDUDQM 1: SDLDQM 1: SDWE
91C820A-329
2006-01-31
TMP91C820A
(3) Interrupt control (1/3) Symbol Name Address
Interrupt enable 0 and AD
7
IADC
6
INTAD IADM2 0 INT2
5
IADM1 R/W 0 Interrupt level
4
IADM0 0
3
I0C R 0 1: INT0
2
INT0 I0M2 0 INT1
1
I0M1 R/W 0 Interrupt level
0
I0M0 0
INTE0AD
90H
R 0 1: INTAD I2C I2M2 0
INTE12
Interrupt enable 2/1
I2M1 R/W 0 Interrupt level
I2M0 0
I1C R 0 1: INT1
I1M2 0 INT3
I1M1 R/W 0 Interrupt level
I1M0 0
91H
R 0 1: INT2
INTALM4 Interrupt enable INTE3ALM4 3 and ALM4 IA4C 92H R 0 1:INTALM4 IA1C 93H R 0 1:INTALM1 IA3C 94H R 0 1:INTALM3 Interrupt enable timer A 1/0 ITA1C 95H R 0 1: INTTA1 Interrupt enable timer A 3/2 ITA3C 96H R 0 1: INTTA3 Interrupt enable INTERTCKEY RTC and KEY IKC 97H R 0 1: INTKEY 0 IKM2 0 INTKEY IKM1 R/W 0 Interrupt level 0 IKM0 IRC R 0 1: INTRTC 0 ITA3M2 0 ITA1M2 0 IA3M2 0 INTALM3 Interrupt INTEALM23 enable ALM2/3 IA3M1 R/W 0 Interrupt level INTTA1(TMRA1) ITA1M1 R/W 0 Interrupt level INTTA3 (TMRA5) ITA3M1 R/W 0 Interrupt level 0 ITA3M0 ITA2C R 0 1: INTTA2 IRM2 0 INTETA23 0 ITA1M0 ITA0C R 0 1: INTTA0 0 INTETA01 0 IA3M0 IA2C R 0 1:INTALM2 0 IA1M2 0 INTALM1 Interrupt INTEALM01 enable ALM0/1 IA1M1 R/W 0 Interrupt level 0 IA1M0 IA0C R 0 1:INTALM0 IA2M2 0 IA4M2 IA4M1 R/W 0 Interrupt level 0 IA4M0 I3C R 0 1: INT3 IA0M2 0 I3M2
I3M1 R/W 0 Interrupt level
I3M0 0
INTALM0 IA0M1 R/W 0 Interrupt level INTALM2 IA2M1 R/W 0 Interrupt level INTTA0 (TMRA0) ITA0M2 ITA0M1 R/W 0 Interrupt level INTTA2 (TMRA4) ITA2M2 ITA2M1 R/W 0 Interrupt level INTRTC IRM1 R/W 0 Interrupt level 0 IRM0 0 ITA2M0 0 ITA0M0 0 IA2M0 0 IA0M0
91C820A-330
2006-01-31
TMP91C820A
Interrupt control (2/3) Symbol Name Address
Interrupt enable serial 0
7
ITX0C
6
INTTX0 ITX0M2 0 INTTX1
5
ITX0M1 R/W 0 Interrupt level
4
ITX0M0 0
3
IRX0C R 0 1: INTRX0
2
INTRX0 IRX0M2 0 INTRX1
1
IRX0M1 R/W 0 Interrupt level
0
IRX0M0 0
INTES0
98H
R 0 1: INTTX0 ITX1C ITX1M2 0
INTES1
Interrupt enable serial 1
ITX1M1 R/W 0 Interrupt level
ITX1M0 0
IRX1C R 0 1: INTRX1
IRX1M2 0
IRX1M1 R/W 0 Interrupt level
IRX1M0 0
99H
R 0 1: INTTX1 ILCD2C ILCDM2 0
INTLCD Interrupt INTES2LCD enable SBI/LCD ILCDM1 R/W 0 Interrupt level INTTC1 INTETC01 Interrupt enable TC0/1 9BH ITC1C R 0 Interrupt enable TC2/3 ITC3C R 0 Interrupt enable PC0/1 IP1C R 0 ITX2C A0H R 0 1: INTTX2 ITB01C A1H R 0 1: INTTB01 0 ITB01M2 0 INTTB01 INTETB0 Interrupt enable TMRB0 ITB01M1 R/W 0 Interrupt level 0 ITB01M0 ITB00C R 0 1: INTTB00 0 0 INTTX2 INTES3 Interrupt enable serial 3 ITX2M2 ITX2M1 R/W 0 Interrupt level 0 ITX2M0 IRX2C R 0 1: INTRX2 0 0 INTP1 INTEP01 9DH IP1M2 IP1M1 R/W 0 0 IP1M0 IP0C R 0 0 0 INTTC3 INTETC23 9CH ITC3M2 ITC3M1 R/W 0 0 ITC3M0 ITC2C R 0 0 ITC1M2 ITC1M1 R/W 0 0 ITC1M0 ITC0C R 0 0 0 ILCDM0 ISBIC R 0 1: INTSBI 0 9AH R 0 1: INTLCD
INTSBI ISBIM2 ISBIM1 R/W 0 Interrupt level INTTC0 ITC0M2 ITC0M1 R/W 0 INTTC2 ITC2M2 ITC2M1 R/W 0 INTP0 IP0M2 IP0M1 R/W 0 INTRX2 IRX2M2 IRX2M1 R/W 0 Interrupt level INTTB00 ITB00M2 ITB00M1 R/W 0 Interrupt level 0 ITB00M0 0 IRX2M0 0 IP0M0 0 ITC2M0 0 ITC0M0 0 ISBIM0
91C820A-331
2006-01-31
TMP91C820A
Interrupt control (3/3) Symbol Name Address
80H
7
6
5
DMA0V5
4
DMA0V4 0 DMA1V4 0 DMA2V4 0 DMA3V4 0 CLRV4 0
3
DMA0V3 0 DMA1V3 0 DMA2V3 0 DMA3V3 0 CLRV3 W 0 DMAR3 R/W 0 DMAB3 R/W
2
DMA0V2 0 DMA1V2 0 DMA2V2 0 DMA3V2 0 CLRV2 0 DMAR2 R/W 0 DMAB2 R/W 0 I0EDGE W 0 INT0 edge 0: Rising 1: Falling
1
DMA0V1 0 DMA1V1 0 DMA2V1 0 DMA3V1 0 CLRV1 0 DMAR1 R/W 0 DMAB1 R/W 0 I0LE W 0 INT0 0: Edge 1: Level
0
DMA0V0 0 DMA1V0 0 DMA2V0 0 DMA3V0 0 CLRV0 0 DMAR0 R/W 0 DMAB0 R/W 0 NMIREE W 0 1: Operation even on NMI rising edge
DMA 0 DMA0V request vector
0 DMA1V5
DMA0 start vector DMA 1 DMA1V request vector R/W 0 DMA2V5 DMA 2 DMA2V request vector 82H 0 DMA3V5 DMA 3 DMA3V request vector 83H 0 CLRV5 0 DMA1 start vector R/W DMA2 start vector R/W DMA3 start vector Interrupt INTCLR clear control DMA software request register DMA burst request register 88H (Prohibit RMW)
81H
Clears interrupt request flag by writing to DMA start vector 89H (Prohibit RMW)
DMAR
1: DMA request in software R/W 0 - W 8CH (Prohibit RMW) 0 Always write "0". - W 0 Always write "0". I3EDGE W 0 INT3 edge 0: Rising 1: Falling I2EDGE W 0 INT2 edge 0: Rising 1: Falling I1EDGE W 0 INT1 edge 0: Rising 1: Falling
DMAB
8AH
1: DMA request on burst mode
IIMC
Interrupt input mode control
91C820A-332
2006-01-31
TMP91C820A
(4) Chip select/wait control (1/2) Symbol Name Address 7
B0E W B0CS Block 0 CS/WAIT control register C0H (Prohibit RMW) 0 0: Disable 1: Enable 01: 10: 11: B1E W B1CS Block 1 CS/WAIT control register C1H (Prohibit RMW) 0 0: Disable 1: Enable 01: 10: 11: B2E W B2CS Block 2 CS/WAIT control register C2H (Prohibit RMW) 1 B2M W 0 01: 10: 11: B3OM1 W 0 00: ROM/SRAM 01: 10: 11: Reserved B3OM0 W 0 Reserved B2OM1 W 0 00: ROM/SRAM B2OM0 W 0 Reserved B1OM1 W 0 00: ROM/SRAM B1OM0 W 0 Reserved
6
5
B0OM1 W 0 00: ROM/SRAM
4
B0OM0 W 0
3
B0BUS W 0 Data bus width 0: 16 bits 1: 8 bits B1BUS W 0 Data bus width 0: 16 bits 1: 8 bits B2BUS W 0 Data bus width 0: 16 bits 1: 8 bits B3BUS W 0 Data bus width 0: 16 bits 1: 8 bits BEXBUS W
2
B0W2 W 0 000: 2 waits 001: 1 wait 011: 0 waits B1W2 W 0 000: 2 waits 001: 1 wait 011: 0 waits B2W2 W 0 000: 2 waits 001: 1 wait 011: 0 waits B3W2 W 0 000: 2 waits 001: 1 wait 011: 0 waits BEXW2 W 0 000: 2 waits 001: 1 wait 011: 0 waits S18 1 V15 1 S18 1 V16 1
1
B0W1 W 0
0
B0W0 W 0 00: Reserved 101: 3 waits 111: 8 waits
010: (1 + N) waits 110: 4 waits B1W1 W 0 B1W0 W 0 100: Reserved 101: 3 waits 111: 8 waits B2W1 W 0 B2W0 W 0 100: Reserved 101: 3 waits 111: 8 waits B3W1 W 0 B3W0 W 0 100: Reserved 101: 3 waits 111: 8 waits BEXW1 W 0 BEXW0 W 0 100: Reserved 101: 3 waits 111: 8 waits S17 1 V14 to V9 1 S17 1 V15 to V9 1 S16 1 V8 1 S16 1 V8
010: (1 + N) waits 110: 4 waits
0: Disable 0: 16 M Area 1: Enable 1: Area set B3E W
010: (1 + N) waits 110: 4 waits
B3CS
Block 3 CS/WAIT control register
C3H (Prohibit RMW)
0 0: Disable 1: Enable
010: (1 + N) waits 110: 4 waits
External CS/WAIT BEXCS control register
C7H (Prohibit RMW)
0 Data bus width 0: 16 bits 1: 8 bits S23 S22 1 V19 1 S22 1 V20 1 S21 1 V18 1 CS0 area size S23 S21 1 V19 1 CS1 area size S20 R/W 1 V20 1 V17 R/W 1 1 S20 R/W 1 V21 1 V18 R/W 1 1 1 1 V17 Start address A23 to A16 1 S19 1 V16 Start address A23 to A16 S19
010: (1 + N) waits 110: 4 waits
Memory start MSAR0 address register 0 Memory address MAMR0 mask register 0 Memory start MSAR1 address register 1 Memory address MAMR1 mask register 1
C8H
C9H
0: Enable to address comparison
CAH
CBH
0: Enable to address comparison
91C820A-333
2006-01-31
TMP91C820A
Chip select/wait control (2/2) Symbol Name Address
CCH
7
S23 1 V22
6
S22 1 V21 1 S22 1 V21 1
5
S21 1 V20 1 CS2 area size S21 1 V20 1 CS3 area size
4
S20 R/W 1 V19 R/W 1 S20 R/W 1 V19 R/W 1
3
S19 1 V18 1 S19 1 V18 1
2
S18 1 V17 1 S18 1 V17 1
1
S17 1 V16 1 S17 1 V16 1
0
S16 1 V15 1 S16 1 V15 1
Memory start MSAR2 address register 2 Memory address MAMR2 mask register 2 Memory start MSAR3 address register 3 Memory address MAMR3 mask register 3
Start address A23 to A16
CDH
1 S23
0: Enable to address comparison
CEH
1 V22
Start address A23 to A16
CFH
1
0: Enable to address comparison
91C820A-334
2006-01-31
TMP91C820A
(5) Clock gear (1/2) Symbol Name Address 7
XEN 1
6
XTEN 1
5
RXEN 1
4
RXTEN R/W 0
Lowfrequency oscillator (fs) after release of STOP mode 0: Stopped
3
RSYSCK 0
2
WUEF 0
1
PRCK1 0
00: fFPH 01: Reserved 10: fc/16
0
PRCK0 0
System clock SYSCR0 control register 0
E0H
HighLowHighfrequency frequency frequency oscillator (fc) oscillator (fs) oscillator (fc) after release 0: Stopped 0: Stopped of STOP 1: Oscillation 1: Oscillation mode 0: Stopped
Select clock Warm-up after release timer of STOP 0 write: mode Don't 0: fc 1: fs
Select prescaler clock
1: Oscillation 1: Oscillation
care 11: Reserved 1 write: Start timer 0 read: End warm up 1 read: Not end warm up GEAR2 R/W 0 1 0 0 GEAR1 GEAR0
SYSCK
System clock SYSCR1 control register 1
System clock selection E1H 0: fc 1: fs
High-frequency gear value selection (fc) 000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 101: (Reserved) 110: (Reserved) 111: (Reserved)
PSENV R/W System clock SYSCR2 control register 2 0 1: Disable 0: Power save mode enable
WUPTM1 1
WUPTM0
HALTM1 1
HALTM0 1
SELDRV 0 mode select 1: STOP 0: IDLE
DRVE 0 1: Drive the pin in STOP/ IDLE1 mode
R/W 0 Warm-up time 00: Reserved 01: 2 input frequency 10: 2 11: 2
14 16 8
E2H
00: Reserved 01: STOP mode 10: IDLE1 mode 11: IDLE2 mode
91C820A-335
2006-01-31
TMP91C820A
Clock gear (2/2) Symbol Name Address 7
PROTECT
6
TA3LCE R/W 0
5
AHOLD R/W 0 Address hold
4
TA3MLE R/W 0 Melody/ alarm
3
-
2
EXTIN R/W 0
1
DRVOSCH
0
DRVOSCL
R 0 EMC EMCCR0 control register 0 E3H
R/W 0 Always write "0".
R/W 1
R/W 1
Protection LCDC flag Source 0: OFF clock 1: ON 0: 32 kHz 1: TA3OUT
0: Disable source 1: Enable clock 0: 32 kHz 1: TA3OUT
1: fc is fc oscillator fs oscillator external driver driver clock ability ability 1: Normal 0: Weak 1: Normal 0: Weak
EMC EMCCR1 control register 1 EMC EMCCR2 control register 2
Switching the protect ON/OFF by writing following 1ST-KEY, 2ND-KEY. E4H Continuation writes in 1ST-KEY: EMCCR1 = 5AH, EMCCR2 = A5H. Continuation writes in 2ND-KEY: EMCCR1 = A5H, EMCCR2 = 5AH. E5H ENFROM R/W 0 CS1A E6H area detect enable ENDROM ENPROM R/W 0 CS2B-2G area detect Enable R/W 0 CS2A area detect FFLAG R/W 0 CS1A write operation flag DFLAG R/W 0 CS2B-2G write operation flag PFLAG R/W 0 CS2A write operation flag 0: Not written 1: Written When writing 0: Clear flag
EMC EMCCR3 control register 3
enable 0: Disable 0: Disable 0: Disable 1: Enable 1: Enable 1: Enable
When reading
(6) DFM (Clock doubler) Symbol Name Address 7
ACT1 R/W 0 DFM DFMCR0 control register 0 E8H
6
ACT0 R/W 0
5
DLUPFG R 0
4
DLUPTM R/W 0
3
2
1
0
DFM LUP fFPH Lock-up Lockup time 00 STOP STOP fOSCH flag 0: End LUP 0: 212/fOSCH 01 RUN RUN f
OSCH
10 RUN STOP
fDFM
11 RUN STOP fOSCH
1: Do not 1: 210/fOSCH end LUP
D7 DFM DFMCR1 control register 1 E9H R/W 0
D6 R/W 0
D5 R/W 0
D4 R/W 1
D3 R/W 0
D2 R/W 0
D1 R/W 1
D0 R/W 1
Write 0BH before starting lockup operation.
91C820A-336
2006-01-31
TMP91C820A
(7) 8-bit timer (7-1) TMRA01 Symbol Name
Address
7
TA0RDE R/W 0
6
5
4
3
I2TA01 R/W 0 IDLE2 0: Stop 1: Operate - W Undefined - W Undefined
2
TA01PRUN
1
TA1RUN R/W 0
0
TA0RUN R/W 0
R/W 0
TA01RUN
8-bit timer RUN
100H
Double buffer 0: Disable 1: Enable
8-bit timer run/stop control 0: Stop and clear 1: Run (Count up)
8-bit TA0REG timer register 0 8-bit TA1REG timer register 1 8-bit timer source TA01MOD CLK and mode Register
102H (Prohibit RMW) 103H (Prohibit RMW) TA01M1 0 104H 00: 8-bit timer 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM TA01M0 0 PWM01 0 00: Reserved 01: 2 PWM cycle 10: 2 11: 2
7 8 6
PWM00 0
TA1CLK1 R/W 0 00: TA0TRG 01: T1 10: T16 11: T256 TA1FFC1
TA1CLK0 0
TA0CLK1 0
TA0CLK0 0
00: TA0IN pin 01: T1 10: T4 11: T16 TA1FFC0 1 TA1FFIE 0
1: TA1FF invert enable
TA1FFIS 0
0: TMRA0 1: TMRA1 inversion
8-bit timer TA1FFCR flip-flop control Register 105H (Prohibit RMW) 1
R/W 00: Invert TA1FF 01: Set TA1FF 10: Clear TA1FF 11: Don't care
R/W
91C820A-337
2006-01-31
TMP91C820A
(7-2) TMRA23 Symbol Name
Address
7
TA2RDE R/W 0
6
5
4
3
I2TA23 R/W 0 IDLE2 0: Stop 1: Operate - W Undefined - W Undefined
2
TA23PRUN
1
TA3RUN R/W 0
0
TA2RUN R/W 0
R/W 0
TA23RUN
8-bit timer RUN
108H
Double buffer 0: Disable 1: Enable
8-bit timer run/stop control 0: Stop and clear 1: Run (Count up)
8-bit TA2REG timer register 0 8-bit TA3REG timer register 1
10AH (Prohibit RMW) 10BH (Prohibit RMW) TA23M1 TA23M0 0 PWM21 0 00: Reserved 01: 2 PWM cycle 10: 2 11: 2
7 8 6
PWM20 0
TA3CLK1 R/W 0 00: TA2TRG 01: T1 10: T16 11: T256 TA3FFC1
TA3CLK0 0
TA2CLK1 0
TA2CLK0 0
8-bit timer TA23MOD source CLK and mode 0 10CH 00: 8-bit timer 01: 16-bit timer 10: 8-bit PPG 11: 8-bit PWM
00: Reserved 01: T1 10: T4 11: T16 TA3FFC0 1 TA3FFIE 0
1: TA3FF invert enable
TA3FFIS 0
0: TMRA2 1: TMRA3 inversion
R/W 8-bit timer TA3FFCR flip-flop control 10DH (Prohibit RMW) 1 00: Invert TA3FF 01: Set TA3FF 10: Clear TA3FF 11: Don't care
R/W
91C820A-338
2006-01-31
TMP91C820A
(8) UART/serial channel (1/3) (8-1) UART/SIO channel 0 Symbol Name Address
Serial SC0BUF channel 0 buffer 200H (Prohibit RMW) RB8 Serial SC0CR channel 0 control 201H R Undefined Receiving data bit8 0 Parity 0: Odd 1: Even TB8 0 Serial SC0MOD0 channel 0 mode0 202H CTSE 0 RXE 0
1: Receive enable
7
RB7/TB7
6
RB6/TB6
5
RB5/TB5
4
RB4/TB4
3
RB3/TB3
2
RB2/TB2
1
RB1/TB1
0
RB0/TB0
R (Receiving)/W (Transmission) Undefined EVEN R/W 0 1: Parity enable PE OERR 0 Overrun WU R/W 0
1: Wakeup enable
PERR 0 1: Error Parity SM1 0
FERR 0 Framing SM0 0
SCLKS R/W 0
IOC 0
R (Cleared to 0 by reading)
0:SCLK0 1: Input SCLK0 1:SCLK0 pin SC1 0 00: TA0TRG 01: Baud rate generator 10: Internal clock fSYS 11: External clock SCLK0 SC0 0
Transmission 1: CTS data bit8 enable
00: I/O Interface 01: UART 7 bits 10: UART 8 bits 11: UART 9 bits
- 0 203H Always write "0".
BR0ADDE 0
BR0CK1 0
BR0CK0 R/W
BR0S3 0
BR0S2 0
BR0S1 0
BR0S0 0
BR0CR
Baud rate control
1: (16 - K)/16 00: T0 divided 01: T2 enable
Setting of the divided frequency "N" (0 to F)
10: T8
11: T32 BR0K3 Serial channel 0 BR0ADD K setting register 204H 0 BR0K2 R/W 0 0 0 Sets frequency divisor "K" (Divided by N = (16 - K)/16) I2S0 Serial SC0MOD1 channel 0 mode1 205H R/W 0 IDLE2 0: Stop FDPX0 R/W 0 Duplex 0: Half BR0K1 BR0K0
1: Operate 1: Full
(8-2) IrDA Symbol Name
Address
7
PLSEL R/W 0
6
RXSEL R/W 0
5
TXEN R/W 0
Transmission
4
RXEN R/W 0
3
SIRWD3 0
2
SIRWD2 0 R/W
1
SIRWD1 0
0
SIRWD0 0
SIRCR
IrDA control register
207H
Transmission Receiving pulse width data
Receiving Set the effective SIRRxD pulse width
0: 3/16 1: 1/16
0: H pulse 1: L pulse
0: Disable 0: Disable Pulse width more than 2x x (Set value + 1) + 100 1: Enable 1: Enable ns Possible: 1 to 14 Not possible: 0, 15
91C820A-339
2006-01-31
TMP91C820A
UART/serial channel (2/3) (8-3) UART/SIO channel 1 Symbol Name Address
Serial SC1BUF channel 1 buffer 208H (Prohibit RMW) RB8 Serial SC1CR channel 1 control 209H R Undefined 0 Receiving Parity data bit8 0: Odd 1: Even TB8 Serial SC1MOD0 channel 1 mode 20AH 0 CTSE 0 RXE 0
1: Receive enable
7
RB7/TB7
6
RB6/TB6
5
RB5/TB5
4
RB4/TB4
3
RB3/TB3
2
RB2/TB2
1
RB1/TB1
0
RB0/TB0
R (Receiving)/W (Transmission) Undefined EVEN R/W 0 1: Parity enable PE OERR 0 Overrun WU R/W 0 0 0 0
00: TA0TRG 01: Baud rate generator 10: Internal clock fSYS 11: External clock SCLK1
PERR 0 1: Error Parity SM1
FERR 0 Framing SM0
SCLKS R/W 0
IOC 0
R (Cleared to 0 by reading)
0: SCLK1 1: Input 1: SCLK1 SCLK1 pin SC1 SC0 0
Transmission 1: CTS enable data bit8
1: Wakeup 00: I/O Interface enable 01: UART 7 bits 10: UART 8 bits 11: UART 9 bits
- 0 20BH Always write "0".
BR1ADDE 0
BR1CK1 0
BR1CK0 R/W 0
BR1S3 0
BR1S2 0
BR1S1 0
BR1S0 0
BR1CR
Baud rate control
1: (16 - K)/16 00: T0 divided 01: T2 enable
Setting of the divided frequency "N" (0 to F)
10: T8
11: T32 BR1K3 Serial channel 1 BR1ADD K setting register 20CH 0 BR1K2 R/W 0 0 0 Sets frequency divisor "K" (Divided by N = (16 - K)/16) I2S1 Serial SC1MOD1 channel 1 mode1 20DH R/W 0 IDLE2 0: Stop FDPX1 R/W 0 Duplex 0: Half BR1K1 BR1K0
1: Operate 1: Full
91C820A-340
2006-01-31
TMP91C820A
UART/serial channel (3/3) (8-4) UART/SIO channel 2 Symbol Name Address
Serial SC2BUF channel 2 buffer 210H (Prohibit RMW) RB8 Serial SC2CR channel 2 control 211H R Undefined Receiving data bit8 0 Parity 0: Odd 1: Even TB8 Serial SC2MOD0 channel 2 mode 212H 0 - 0 RXE 0 WU R/W 0 0 0 0
00: TA0TRG 01: Baud rate generator 10: Internal clock fSYS 11: Reserved
7
RB7/TB7
6
RB6/TB6
5
RB5/TB5
4
RB4/TB4
3
RB3/TB3
2
RB2/TB2
1
RB1/TB1
0
RB0/TB0
R (Receiving)/W (Transmission) Undefined EVEN R/W 0 1: Parity enable PE OERR 0 Overrun PERR 0 1: Error Parity SM1 Framing SM0 FERR 0 - R/W 0 Always write "0". 0 Always write "0". - R (Cleared to 0 by reading)
SC1
SC0 0
Transmission Always data bit8 write "0".
1: Receive 1: Wakeup 00: Reserved enable enable 01: UART 7 bits
10: UART 8 bits 11: UART 9 bits
- 0 213H
Always write "0".
BR2ADDE 0
BR2CK1 0
BR2CK0 R/W 0
BR2S3 0
BR2S2 0
BR2S1 0
BR2S0 0
BR2CR
Baud rate control
1: (16 - K)/16 00: T0 divided 01: T2 enable
Setting of the divided frequency "N" (0 to F)
10: T8
11: T32 BR1K3 Serial channel 2 BR2ADD K setting register 214H 0 BR1K2 R/W 0 0 0 Sets frequency divisor "K" (Divided by N = (16 - K)/16) I2S2 Serial SC2MOD1 channel 2 mode1 215H R/W 0 IDLE2 0: Stop FDPX2 R/W 0 Duplex 0: Half BR1K1 BR1K0
1: Operate 1: Full
91C820A-341
2006-01-31
TMP91C820A
(9) I2C bus/serial interface (1/2) Symbol Name Address
240H 2 (I C bus mode) (Prohibit RMW) SBI0CR1 Serial bus interface control register 1 240H (SIO mode) (Prohibit RMW)
7
BC2
6
BC1
5
BC0
4
ACK R/W 0
Acknowledge mode 0: Disable 1: Enable
3
2
SCK2
1
SCK1
0
SCK0 /SWRMON
W 0 0 0 Number of transfer bits 000: 8 001: 1 010: 2 011: 3 100: 4 101: 5 110: 6 111: 7 SIOS SIOINH SIOM1 W W W 0 0 0 Transfer 0: Stop 1: Start
SIOM0 W 0
W W R/W 0 0 0/1 Setting for the devisor value n 000: 5 001: 6 010: 7 011: 8 100: 9 101: 10 110: 11 111: (Reserved) SCK2 SCK1 SCK0 W W W 0 0 0 Setting for the divisor value n 000: 4 001: 5 010: 6 011: 7 100: 8 101: 9 110: 10 111: SCK pin DB3 DB2 DB1 DB0
Transfer mode Transfer 0: Continue 00: 8-bit transmit mode 1: Abort 10: 8-bit transmit/ receive mode 11: 8-bit received mode DB6 DB5 DB4
SBI SBI0DBR buffer register
241H (Prohibit RMW)
DB7
R (Receiving)/W (Transmission) Undefined SA6 SA5 W 0 SA4 W 0 SA3 W 0 SA2 W 0 SA1 W 0 SA0 W 0 ALS W 0 Address recognition 0: Enable 1: Disable LRB/ SWRST0 R/W 0 Lost receive bit monitor 0: 0 1: 1 W 0
I2CBUS I2C0AR address register
242H (Prohibit RMW)
Setting slave address
MST R/W Serial bus When interface read status SBI0SR register 0 0: Slave 1: Master 243H 2 (I C bus mode) (Prohibit RMW)
TRX R/W 0
BB R/W 0
PIN R/W 1 INTSBI request monitor
AL/SBIM1 AAS/SBIM0 R/W 0 R/W 0 Slave address match detection monitor 1: Detect
AD0/ SWRST R/W 0 GENERAL CALL detection monitor 1: Detect
0: Receiver Bus status 1: Transmit monitor
0: Free 1: Busy
Arbitration lost detection 0: Request monitor 1: Detect 1: Cancel
Serial bus When interface write control SBI0CR2 register 2
Start/stop condition generation 0: Start condition 1: Stop condition
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved) SIOF/SBIM1 SEF/SBIM2
Software reset generate write "10" and "01", then an internal reset signal is generated.
- W 0
- W 0
R When read SBI0SR Serial bus interface status register 0
monitor 0: Stopped 1: Terminated in process
R 0
status monitor 0: Stopped 1: Terminated in process
Transfer status Shift operation
243H (SIO mode) (Prohibit RMW)
Serial bus When interface write control SBI0CR2 register 2
Serial bus interface operating mode selection 00: Port mode 01: SIO mode 10: I2C bus mode 11: (Reserved)
Always write "0".
Always write "0".
91C820A-342
2006-01-31
TMP91C820A
I2C bus/serial interface (2/2) Symbol Name Address
244H
7
- W
6
I2SBI0 R/W 0 IDLE2 0: Abort 1: Operate - W 0 Always write "0".
5
4
3
2
1
0
Serial bus interface SBI0BR0 baud rate register 0
0 (Prohibit RMW) Always write "0". P4EN W
Serial bus interface SBI0BR1 baud rate register 1
245H 0 (Prohibit Clock RMW) control 0: Abort 1: Operate
91C820A-343
2006-01-31
TMP91C820A
(10) AD converter Symbol Name Address 7
EOCF R ADMOD0 AD mode register 0 2B0H 0 1: End 0 1: Busy
6
ADBF
5
- R/W 0 Always write "0".
4
- R/W 0 Always write "0".
3
ITM0 R/W 0 Interrupt in repeat mode ADTRGE R/W 0
2
REPEAT R/W 0 1: Repeat
1
SCAN R/W 0 1: Scan
0
ADS R/W 0 1: Start
VREFON R/W 0 1: VREF on ADMOD1 AD mode register 1 2B1H
I2AD R/W 0 IDLE2 0: Abort 1: Operate
ADCH2 0
ADCH1 R/W 0
ADCH0 0
1: Enable Input channel for 000: AN0 AN0 external 001: AN1 AN0 AN1 start
010: AN2 AN0 AN1 AN2 011: AN3 AN0 AN1 AN2 AN3 100: AN4 AN4 101: AN5 AN4 AN5 110: AN6 AN4 AN5 AN6 111: AN7 AN4 AN5 AN6 AN7
AD result ADREG04L register 0/4 low AD result ADREG04H register 0/4 high AD result ADREG15L register 1/5 low AD result ADREG15H register 1/5 high AD result ADREG26L register 2/6 low AD result ADREG26H register 2/6 high AD result ADREG37L register 3/7 low AD result ADREG37H register 3/7 high
ADR01 2A0H ADR09 2A1H ADR11 2A2H ADR19 2A3H ADR21 2A4H ADR29 2A5H ADR31 2A6H ADR39 2A7H R R R R
ADR00
ADR0RF R 0 ADR07 ADR06 R Undefined ADR05 ADR04 ADR03 ADR02
Undefined ADR08
ADR10
ADR1RF R 0 ADR17 ADR16 R Undefined ADR15 ADR14 ADR13 ADR12
Undefined ADR18
ADR20
ADR2RF R 0 ADR27 ADR26 R Undefined ADR25 ADR24 ADR23 ADR22
Undefined ADR28
ADR30
ADR3RF R 0 ADR37 ADR36 R Undefined ADR35 ADR34 ADR33 ADR32
Undefined ADR38
91C820A-344
2006-01-31
TMP91C820A
(11) Watchdog timer Symbol Name Address 7
WDTE R/W 1 WDT WDMOD mode register 300H 1: WDT enable
6
WDTP1 R/W 0 00: 2 /fSYS 01: 2 /fSYS 10: 2 /fSYS 11: 2 /fSYS
21 19 17 15
5
WDTP0 R/W 0
4
3
2
I2WDT R/W 0 IDLE2
1
RESCR R/W 0
0
- R/W 0
1: RESET Always connect write "0". 0: Abort internally 1: Operate WDT out to reset pin
WDCR
WD control
301H (Prohibit RMW) B1H: WDT disable
- W - 4EH: WDT clear
91C820A-345
2006-01-31
TMP91C820A
(12) RTC (Real time clock) Symbol
SECR
Name
Second register
Address
320H
7
6
SE6
5
SE5
4
SE4
3
SE3 R/W Undefined
2
SE2
1
SE1
0
SE0
"0" is read. Minute register
40 sec MI6
20 sec MI5
10 sec MI4
8 sec MI3 R/W Undefined
4 sec MI2
2 sec MI1
1 sec MI0
MINR
321H "0" is read. 40 min 20 min HO5 10 min HO4
8 min HO3 R/W
4 min HO2
2 min HO1
1min HO0
HOURR
Hour register
322H "0" is read. 20 hour (PM/AM) 10 hour
Undefined 8 hour 4 hour WE2 2 hour WE1 R/W Undefined "0" is read. DA5 DA4 DA3 R/W Undefined 0 0 Day 20 Day 10 MO4 Day 8 MO3 Day 4 MO2 R/W Undefined "0" is read. 10 month "0" is read. 8 month 4 month 2 month 1 month 0: Indicator for 12 hours 1: Indicator for 24 hours YE7 YE6 YE5 YE4 R/W Undefined 80 year INTENA R/W 40 year 20 year 10 year ADJUST W Undefined "0" is read. 0: Don't care 1: Adjust Clock 1: Enable RE3 W Undefined 1 Hz 1: Clock 0: Disable 0: Disable reset 1: Enable 1: Enable 16 Hz 1: Alarm reset Always write "0". 8 year 4 year 2 year 1 year PAGE R/W Undefined "0" is read. PAGE setting YE3 YE2 YE1 YE0 Day 2 MO1 Day 1 MO0 W2 DA2 W1 DA1 W0 DA0 1 hour WE0
DAYR
Day register
323H
DATER
Date register
324H
325H PAGE0 PAGE1
MONTHR
Month register
YEARR
Year register
326H PAGE0 PAGE1
"0" is read.
ENATMR ENAALM
Leap year setting R/W Undefined ALARM 1: Enable RE2 RE1 RE0 0: Disable 0: Disable
PAGER
Page register
327H (Prohibit RMW)
0 INTRTC 0: Disable 1: Enable DIS1HZ DIS16HZ RSTTMR
RSTALM
RESTR
Reset register
328H (Prohibit RMW)
91C820A-346
2006-01-31
TMP91C820A
(13) Melody/alarm generator Symbol
ALM
Name
Alarm pattern register
Address
330H
7
AL8 0 FC1 R/W 0
6
AL7 0 FC0 0
5
AL6 0 ALMINV R/W 0 Alarm waveform invert 1: Invert
4
AL5 R/W 0 - 0
3
AL4 0 - R/W 0
2
AL3 0 - 0
1
AL2 0 - 0
0
AL1 0 MELALM R/W 0 Output frequency 0: Alarm 1: Melody
Alarm - Pattern set
MEL ALMC
Melody/ alarm control register
331H
Free-run counter control 00: Hold 01: Restart 10: Clear 11: Clear and start ML7 ML6 0
Always write "0".
ML5 0
ML4 R/W 0
ML3 0 ML11 0
ML2 0 ML10 R/W 0
ML1 0 ML9 0
ML0 0 ML8 0
MELFL
Melody frequency register-L
332H 0 MELON R/W 0 Melody counter control 0: Stop and clear 1: Start -
Melody frequency set (Low 8 bits)
MELFH
Melody frequency register-H
Melody frequency set (High 4 bits)
333H
IALM4E 0
IALM3E 0
IALM2E R/W 0
IALM1E 0
IALM0E 0
Alarm interrupt ALMINT enable register
R/W 334H 0 Always write "0".
INTALM4 to INTALM0 alarm interrupt enable
91C820A-347
2006-01-31
TMP91C820A
(14) MMU Symbol Name Address 7
L0E R/W
LOCAL0
6
5
4
3
2
L0EA22
1
L0EA21 R/W 0
0
L0EA20
0 350H BANK for LOCAL 0 0: Disable 1: Enable L1E R/W
LOCAL0 control
register
Set BANK number for LOCAL0 Do not set "000" because of common area L1EA23 0 Set BANK number for LOCAL1 Do not set "001" because of common area L2EA23 0 Set BANK number for LOCAL2 Do not set "111" because of common area L3EA26 0 L3EA25 0 L3EA24 R/W 0 0 0 00000 to 00011 : CS2B 00100 to 00111 : CS2C 01000 to 01011 : CS2D 01100 to 01111 : CS2E 10000 to 10011 : CS2F 10100 to 10111 : CS2G L3EA23 L3EA22 L2EA22 R/W L2EA21 L1EA22 R/W L1EA21
LOCAL1
0 351H BANK for LOCAL 1 0: Disable 1: Enable L2E R/W
LOCAL1 control
register
LOCAL2
0 352H BANK for LOCAL 2 0: Disable 1: Enable L3E R/W
LOCAL2 control
register
LOCAL3
0 353H BANK for LOCAL 3 0: Disable 1: Enable
LOCAL3 control
register
11000 to 11111 : Set prohibition
91C820A-348
2006-01-31
TMP91C820A
(15) LCD controller (1/5) Symbol Name Address 7
BAE 0 04B0H
6
AAE 0
5
SCPW1 1
4
SCPW0 R/W 0
3
- 0 Always write "0".
2
BULK 0 SDRAM bank selection 0: 64 Mbit
1
RAMTYPE
0
MODE 0 Mode selection 0: RAM 1: SR
LCD LCDMODE mode register
0 Display RAM Selection 0: SRAM
Used by B Used by A SCP width AREA AREA 00: Base mode 0: Disable 0: Disable 01: 2 clocks 1: Enable 1: Enable 10: 4 clocks 11: 8 clocks FMN7 FMN6 0 COM2 0 0101: 400 0110: 480 FMN5 0 COM1 0 FMN4
1: 128 Mbit 1: SDRAM FMN3 R/W 0 SEG3 R/W 0 0000: 128 0001: 160 0010: 240 0011: 320 0100: 400 Other: Reserve FMN2 0 SEG2 0 0101: 480 0110: 560 0111: 640 FMN1 0 SEG1 0 FMN0 0 SEG0 0
Divide LCDDVM Frame register
04B1
0 COM3 0
0 COM0 0
Setting Frame invert adjust function bit7 to bit0
LCD LCDSIZE size register
Setting the LCD common number for SR type 04B2H 0000: 128 0001: 160 0010: 200 0011: 240 0100: 320 Other: Reserve LCDON 0
DOFF
Setting the LCD segment number for SR type
ALL0 0 Transfer data of exclusive bus for LCD 0:Normal 1:All display data 0
FRMON 0 Divided FR mode 0: Disable 1: Enable
- R/W 0 Always write "0".
FP9 0 Setting bit9 for fFP [9:0]
MMULCD 0
FP8 0
START 0 Start control in SR type 0: Stop 1: Start
LCDCTL
LCD control register
port 04B3H 0: OFF 1: ON
Specify Setting address bit8 for of LCD fFP [9:0] driver with built-in RAM 0: OFF 1: ON
LCDFFP
LCD Frame Frequency Register
FP7 04B4H 0
FP6 0
FP5 0
FP4 R/W 0
FP3 0
FP2 0
FP1 0 GRAY1 R/W
FP0 0 GRAY0 R/W 0
fFP set value bit7 to bit0
LCDGL
LCD gray level register
0 04B5H 01: 4 levels 10: 8 levels 11: 16 levels
00: Monochrome
91C820A-349
2006-01-31
TMP91C820A
LCD controller (2/5) Symbol Name Address 7
CDE R/W LCD cursor LCDCM mode register 0 04B6H Cursor 0: OFF 1: ON 0 Cursor color 0: White 1: Black 0 00: Don't blink 01: 2 Hz 10: 1 Hz 11: 0.5 Hz CW4 LCD cursor LCDCW width register 0 CW3 0 CW2 R/W 04B7H 0 Cursor width (X size) 00000: 1 dot (Min) 11111: 32 dots (Max) CW4 LCD cursor LCDCH height register 0 CW3 0 CW2 R/W 04B8H 0 Cursor height (Y size) 00000: 1 dot (Min) 11111: 32 dots (Max) LCD cursor APB register APB 3 04B9H 0 CAP 7 04BAH 0 CAP 15 04BBH 0 CAP 23 04BCH 0 CAP 6 0 CAP 14 0 CAP 22 1 CAP 5 0 CAP 13 0 CAP 21 0 CAP 4 R/W 0 CAP 12 R/W 0 CAP 20 R/W 0 0 0 0 0 Setting bit23 to bit16 for cursor absolute position 0 CAP 19 0 CAP 18 0 CAP 17 0 CAP 16 Setting bit15 to bit8 for cursor absolute position 0 CAP 11 0 CAP 10 0 CAP 9 0 CAP 8 Setting bit7 to bit0 for cursor absolute position CAP 3 APB 2 R/W 0 CAP 2 0 CAP 1 0 CAP 0 Setting bit3 to bit0 for cursor absolute position APB 1 APB 0 0 0 CW1 CW0 0 0 CW1 CW0
6
CCS
5
4
3
2
1
CBE1 R/W
0
CBE0 0
Cursor blink interval
LCDCP
LCD cursor LCDCPL AP register-L LCD cursor LCDCPM AP register-M LCD cursor LCDCPH AP register-H
91C820A-350
2006-01-31
TMP91C820A
LCD controller (3/5) Symbol
LSARAM
Name
A area start address register-M A area start address register-H A area end address register-M A area end address register-H B area start address register-M B area start address register-H B area end address register-M B area end address register-H C area start address register-L C area start address register-M C area start address register-H
Address
04C0H
7
SA15 0 SA23
6
SA14 0 SA22 1 EA14 0 EA22 1 SA14 0 SA22 1 EA14 0 EA22 1 SA6 0 SA14 0 SA22 1
5
SA13 0 SA21 0 EA13 0 EA21 0 SA13 0 SA21 0 EA13 0 EA21 0 SA5 0 SA13 0 SA21 0
4
SA12 R/W 0 SA20 R/W 0 EA12 R/W 0 EA20 R/W 0 SA12 R/W 0 SA20 R/W 0 EA12 R/W 0 EA20 R/W 0 SA4 R/W 0 SA12 R/W 0 SA20 R/W 0
3
SA11 0 SA19 0 EA11 0 EA19 0 SA11 0 SA19 0 EA11 0 EA19 0 SA3 0 SA11 0 SA19 0
2
SA10 0 SA18 0 EA10 0 EA18 0 SA10 0 SA18 0 EA10 0 EA18 0 SA2 0 SA10 0 SA18 0
1
SA9 0 SA17 0 EA9 0 EA17 0 SA9 0 SA17 0 EA9 0 EA17 0 SA1 0 SA9 0 SA17 0
0
SA8 0 SA16 0 EA8 0 EA16 0 SA8 0 SA16 0 EA8 0 EA16 0 SA0 0 SA8 0 SA16 0
Set start address A15 to A8 for the source data memory in A area.
LSARAH
04C1H
0 EA15
Set start address A23 to A16 for the source data memory in A area.
LEARAM
04C2H
0 EA23
Set end address A15 to A8 for the source data memory in A area.
LEARAH
04C3H
0 SA15
Set end address A23 to A16 for the source data memory in A area.
LSARBM
04C4H
0 SA23
Set start address A15 to A8 for the source data memory in B area.
LSARBH
04C5H
0 EA15
Set start address A23 to A16 for the source data memory in B area.
LEARBM
04C6H
0 EA23
Set end address A15 to A8 for the source data memory in B area.
LEARBH
04C7H
0 SA7
Set end address A23 to A16 for the source data memory in B area.
LSARCL
04C8H
0 SA15
Set start address A7 to A0 for the source data memory in C area.
LSARCM
04C9H
0 SA23
Set start address A15 to A8 for the source data memory in C area.
LSARCH
04CAH
0
Set start address A23 to A16 for the source data memory in C area.
91C820A-351
2006-01-31
TMP91C820A
LCD controller (4/5) Symbol
LG0L
Name
LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H
Address
04D0H
7
0
6
0
5
0
4
R/W 0
3
0
2
0
1
0
0
0
LG0H
04D1H
R/W 0 0 0 0 0 0 0 0
LG1L
04D2H
R/W 0 0 0 0 0 0 0 0
LG1H
04D3H
R/W 1 0 0 0 0 0 0 0
LG2L
04D4H
R/W 1 0 0 0 0 0 0 0
LG2H
04D5H
R/W 1 0 0 0 0 0 0 0
LG3L
04D6H
R/W 1 0 0 0 0 0 0 0
LG3H
04D7H
R/W 1 0 0 0 1 0 0 0
LG4L
04D8H
R/W 1 0 0 0 1 0 0 0
LG4H
04D9H
R/W 1 0 0 0 1 0 0 0
LG5L
04DAH
R/W 1 0 0 0 1 0 1 0
LG5H
04DBH
R/W 1 0 0 0 1 0 0 0
LG6L
04DCH
R/W 1 0 0 0 1 0 1 0
LG6H
04DDH
R/W 1 0 0 0 1 0 1 0
LG7L
04DEH
R/W 1 0 1 0 1 0 1 0
LG7H
04DFH
R/W 1 0 0 0 1 0 1 0
91C820A-352
2006-01-31
TMP91C820A
LCD controller (5/5) Symbol
LG8L
Name
LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H LCD gray level data setting register-L LCD gray level data setting register-H
Address
04E0H
7
1
6
0
5
1
4
R/W 0
3
1
2
0
1
1
0
0
LG8H
04E1H
R/W 1 0 1 0 1 0 1 0
LG9L
04E2H
R/W 0 1 0 1 0 1 0 1
LG9H
04E3H
R/W 1 1 0 1 0 1 0 1
LGAL
04E4H
R/W 1 1 0 1 0 1 0 1
LGAH
04E5H
R/W 1 1 0 1 0 1 0 1
LGBL
04E6H
R/W 1 1 0 1 0 1 0 1
LGBH
04E7H
R/W 1 1 0 1 1 1 0 1
LGCL
04E8H
R/W 1 1 0 1 1 1 0 1
LGCH
04E9H
R/W 1 1 0 1 1 1 0 1
LGDL
04EAH
R/W 1 1 0 1 1 1 0 1
LGDH
04EBH
R/W 1 1 1 1 1 1 0 1
LGEL
04ECH
R/W 1 1 0 1 1 1 0 1
LGEH
04EDH
R/W 1 1 0 1 1 1 0 1
LGFL
04EEH
R/W 1 1 1 1 1 1 1 1
LGFH
04EFH
R/W 1 1 1 1 1 1 1 1
91C820A-353
2006-01-31
TMP91C820A
(16) SDRAM controller Symbol Name Address 7
SDINI R/W SDRAM SDACR address control 0 04F0H Auto initialize 1: Enable SFRC 0 04F1H Self refresh
6
SWRC R/W 0 Write recovery 1: 2 clocks SRS2 0
5
- R/W 1
4
- R/W 0
3
SMUXE 0 Address multiplex
2
SMUXW1 0 SDRAM select R/W
1
SMUXW0 0
0
SMAC 0
Always write "10".
0: Disable 0: 1 clock SRS1 R/W SDRAM SDRCR refresh control 0 0 100: 195 states 101: 210 states 110: 249 states 111: 312 states SRS0
Access 00:16 Mbits 10: 128 Mbits cycle 0: Disable 01: 64 Mbits 11: Reserved 0: Disable 1: Enable SASFRC 0 Auto self refresh 0: Disable 1: Enable 1: Enable SRC R/W 0 Auto refresh 0: Disable 1: Enable
Auto refresh interval
000: 78 states 0: Disable 001: 97 states 1: Enable 010: 124 states 011: 156 states
91C820A-354
2006-01-31
TMP91C820A
(17) 16-bit timer Symbol Name Address 7
TB0RDE R/W TB0RUN 16-bit Timer control register 0 180H Double buffer 0: Disable 1: Enable - 16-bit timer source CLK and mode register R/W 0 182H (Prohibit RMW) 0 Always write "00". - TB0CPOI W* 1
0: Soft capture 1: Undefined
6
- R/W 0 Always write "0".
5
4
3
I2TB0 R/W 0 IDLE2 0: Stop
2
TB0PRUN R/W 0
1
0
TB0RUN R/W 0
16-bit timer run/stop control 0: Stop and clear
1: Operate 1: Run (Count up) - 0 - 0 TB0CLE R/W 0 1: UC0 clear enable 0 Source clock 00: Reserved 01: T1 10: T4 11: T16 0 Always write "00". TB0CLK1 TB0CLK0
TB0MOD
- W 1 16-bit timer flip-flop control register
- 1
- 0 Always write "0".
TB0C0T1 TB0E1T1 R/W 0 0
TB0E0T1 0
TB0FF0C1 TB0FF0C0 W* 0 01: Set 10: Clear 11: Don't care 0 00: Invert TB0FF0
Always write "11". 183H (Prohibit RMW)
TB0FF0 invert trigger 0: Trigger disable 1: Trigger enable
Invert when the UC value is loaded in to TB0CP0. Invert when the UC value matches the value in TB0RG1. Invert when the UC value matches the value in TB0RG0.
TB0FFCR
Always read as "11".
TB0RG0L
16-bit timer register 0-L
188H (Prohibit RMW) 189H (Prohibit RMW) 18AH (Prohibit RMW) 18BH (Prohibit RMW)
- W Undefined - W Undefined - W Undefined - W Undefined -
16-bit timer TB0RG0H register 0-H 16-bit timer register 1-L
TB0RG1L
16-bit timer TB0RG1H register 1-H TB0CP0L Capture register 0-L Capture register 0-H Capture register 1-L Capture register 1-H
18CH
R Undefined -
TB0CP0H
18DH
R Undefined -
TB0CP1L
18EH
R Undefined -
TB0CP1H
18FH
R Undefined
91C820A-355
2006-01-31
TMP91C820A
6.
Points of Note and Restrictions
(1) Notation a. b. The notation for built-in/ I/O registers is as follows register symbol (e.g., TA01RUN denotes bit TA0RUN of register TA01RUN). Read-modify-write instructions An instruction in which the CPU reads data from memory and writes the data to the same memory location in one instruction. Example 1: Example 2: SET INC 3, (TA01RUN) ... Set bit 3 of TA01RUN. 1, (100H) ... Increment the data at 100H.
Examples of read-modify-write instructions on the TLCS-900 Exchange instruction EX (mem), R
Arithmetic operations ADD SUB INC (mem), R/# (mem), R/# #3, (mem) ADC SBC DEC (mem), R/# (mem), R/# #3, (mem)
Logic operations AND XOR (mem), R/# (mem), R/# OR (mem), R/#
Bit manipulation operations STCF SET TSET #3/A, (mem) #3, (mem) #3, (mem) RES CHG #3, (mem) #3, (mem)
Rotate and shift operations RLC RL SLA SLL RLD c. (mem) (mem) (mem) (mem) (mem) RRC RR SRA SRL RRD (mem) (mem) (mem) (mem) (mem)
fc, fs, fFPH, fSYS and one state The clock frequency input on X1 and 2 is called fOSCH. The clock selected by DFMCR0 is called fc. The clock selected by SYSCR1 is called fFPH. The clock frequency give by fFPH divided by 2 is called fSYS. One cycle of fSYS is referred to as one state.
91C820A-356
2006-01-31
TMP91C820A
(2) Points of note a. AM0 and AM1 pins This pin is connected to the VCC or the VSS pin. Do not alter the level when the pin is active. b. c. d. EMU0 and EMU1 Open pins. Reserved address areas The TMP91C820A does not have any reserved areas. Warm-up counter The warm-up counter operates when STOP mode is released, even if the system is using an external oscillator. As a result a time equivalent to the warm-up time elapses between input of the release request and output of the system clock. e. Programmable pull-up resistance The programmable pull-up resistor can be turned ON/OFF by a program when the ports are set for use as input ports. When the ports are set for use as output ports, they cannot be turned ON/OFF by a program. The data registers (e.g., P5) are used to turn the pull-up/pull-down resistors ON/OFF. Consequently read-modify-write instructions are prohibited. f. Watchdog timer The watchdog timer starts operation immediately after a reset is released. When the watchdog timer is not to be used, disable it. g. AD converter The string resistor between the VREFH and VREFL pins can be cut by a program so as to reduce power consumption. When STOP mode is used, disable the resistor using the program before the HALT instruction is executed. h. CPU (Micro DMA) Only the "LDC cr, r" and "LDC r, cr" instructions can be used to access the control registers in the CPU (e.g., the transfer source address register (DMASn)). i. j. k. Undefined SFR The value of an undefined bit in an SFR is undefined when read. POP SR instruction Please execute the POP SR instruction during DI condition. Releasing the HALT mode by requesting an interruption Usually, interrupts can release all halt status. However, the interrupts ( NMI , INT0 to INT3, INTKEY, INTRTC, INTALM0 to INTALM4) which can release the HALT mode may not be able to do so if they are input during the period CPU is shifting to the HALT mode (for about 5 clocks of fFPH) with IDLE1 or STOP mode (IDLE2 is not applicable to this case). (In this case, an interrupt request is kept on hold internally.) If another interrupt is generated after it has shifted to the HALT mode completely, halt status can be released without difficulty. The priority of this interrupt is compared with that of the interrupt kept on hold internally, and the interrupt with higher priority is handled first followed by the other interrupt.
91C820A-357
2006-01-31
TMP91C820A
7.
Package Dimensions
P-LQFP144-1616-0.40C Unit: mm
91C820A-358
2006-01-31


▲Up To Search▲   

 
Price & Availability of TMP91C820A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X